Class: Rhino::RubyObject
- Includes:
- J::Wrapper
- Defined in:
- lib/rhino/ruby_object.rb
Defined Under Namespace
Classes: Prototype
Instance Method Summary collapse
- #getClassName ⇒ Object
- #getIds ⇒ Object
- #getPrototype ⇒ Object (also: #prototype)
-
#initialize(object) ⇒ RubyObject
constructor
A new instance of RubyObject.
- #put(key, start, value) ⇒ Object
- #to_s ⇒ Object
- #unwrap ⇒ Object
Constructor Details
#initialize(object) ⇒ RubyObject
Returns a new instance of RubyObject.
6 7 8 9 |
# File 'lib/rhino/ruby_object.rb', line 6 def initialize(object) super() @ruby = object end |
Instance Method Details
#getClassName ⇒ Object
15 16 17 |
# File 'lib/rhino/ruby_object.rb', line 15 def getClassName() @ruby.class.name end |
#getIds ⇒ Object
32 33 34 |
# File 'lib/rhino/ruby_object.rb', line 32 def getIds() @ruby.public_methods(false).map {|m| m.gsub(/(.)_(.)/) {java.lang.String.new("#{$1}#{$2.upcase}")}}.to_java end |
#getPrototype ⇒ Object Also known as: prototype
19 20 21 |
# File 'lib/rhino/ruby_object.rb', line 19 def getPrototype() Prototype::Generic end |
#put(key, start, value) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rhino/ruby_object.rb', line 23 def put(key, start, value) if @ruby.respond_to?("#{key}=") @ruby.send("#{key}=", To.ruby(value)) value else super end end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/rhino/ruby_object.rb', line 36 def to_s "[Native #{@ruby.class.name}]" end |
#unwrap ⇒ Object
11 12 13 |
# File 'lib/rhino/ruby_object.rb', line 11 def unwrap @ruby end |