[jruby-user] accessing fields from class

3 views
Skip to first unread message

Roderich T.

unread,
Mar 3, 2015, 8:26:29 AM3/3/15
to us...@jruby.codehaus.org
Hello,
what is the correct usage of field_accessor and field_reader?

I am calling a java class in my project, that is originally written in
Ruby and has been transferred using "jrubyc --javac myclass.rb". In
myclass.rb I use attr_accessor.

attr_accessor does obviously not work in a java class file. So it is
recommended to use field_accessor or field_reader instead. But the
result is an error "NameError: cannot initialize Java class". So what is
the correct way to make a field accessible in java classes?

Thanks Roderich

--
Posted via http://www.ruby-forum.com/.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Reply all
Reply to author
Forward
0 new messages