You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it should be possible to access the inner class attr using the syntax ClassWithAttr.attr. This works for ClassWithAttr.id, and you can get to the field using ClassWithAttr.id.value. This should work for ClassWithAttr.id.value as well, but currently fails with an exception:
$ rvm use jruby
Using /Users/uwe/.rvm/gems/jruby-1.7.13
$ javac ClassWithAttr.java
$ irb
jruby-1.7.13 :001 > Java::ClassWithAttr.id.value
=> 42
jruby-1.7.13 :002 > Java::ClassWithAttr.attr.value
NoMethodError: private method `attr' called for Java::Default::ClassWithAttr:Class
from (irb):2:in `evaluate'
from org/jruby/RubyKernel.java:1101:in `eval'
from org/jruby/RubyKernel.java:1501:in `loop'
from org/jruby/RubyKernel.java:1264:in `catch'
from org/jruby/RubyKernel.java:1264:in `catch'
from /Users/uwe/.rvm/rubies/jruby-1.7.13/bin/irb:13:in `(root)'
As a side note, on Ruboto we get a slightly different error message (ruboto/ruboto#654):
(NoMethodError) undefined method `attr' for Java::Android::R:Class
The text was updated successfully, but these errors were encountered:
wondered where's that attr method coming from - initially thought its some internal of Java integration.
... but its a valid Module method (attr_reader alias): http://ruby-doc.org/core-2.3.0/Module.html#method-i-attr ... thus this won't fix, workaround: Module.send :remove_method, :attr
Hi!
Given the following Java class:
it should be possible to access the inner class
attr
using the syntaxClassWithAttr.attr
. This works forClassWithAttr.id
, and you can get to the field usingClassWithAttr.id.value
. This should work forClassWithAttr.id.value
as well, but currently fails with an exception:As a side note, on Ruboto we get a slightly different error message (ruboto/ruboto#654):
The text was updated successfully, but these errors were encountered: