Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.2
-
Fix Version/s: None
-
Component/s: Java Integration
-
Labels:None
-
Number of attachments :
Description
Sometimes it would be nice to permit this:
public interface MyInterface { public void getProperty(String key); }
Unable to find source-code formatter for language: ruby. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
obj.getProperty(:some_key)
Currently this gives me:
<unknown>:1: #<NameError::Message:0x4f77a035> (NoMethodError)
To some extent it would be nice if hashes with Symbol keys could also support get() by string from the Java side, but that's probably a different enhancement and somewhat easier to work around in the first place.
-1. Sorry, and I've been all for simplifying Java-Ruby transitional boundaries (because I believe JRuby's great undiscovered country lies in Java integration, not Rails), but IMO that would be an abuse of the Ruby Symbol type, which (in not-quite-translatable Java terms) is something like an enum, or even an int – it's a memorable primitive. Opinions?