Class: Rhino::RubyObject

Inherits:
J::ScriptableObject
  • Object
show all
Includes:
J::Wrapper
Defined in:
lib/rhino/ruby_object.rb

Defined Under Namespace

Classes: Prototype

Instance Method Summary collapse

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

#getClassNameObject



15
16
17
# File 'lib/rhino/ruby_object.rb', line 15

def getClassName()
  @ruby.class.name
end

#getIdsObject



23
24
25
# File 'lib/rhino/ruby_object.rb', line 23

def getIds()
  @ruby.public_methods(false).map {|m| m.gsub(/(.)_(.)/) {"#{$1}#{$2.upcase}"}}.to_java
end

#getPrototypeObject Also known as: prototype



19
20
21
# File 'lib/rhino/ruby_object.rb', line 19

def getPrototype()
  Prototype::Generic
end

#to_sObject



27
28
29
# File 'lib/rhino/ruby_object.rb', line 27

def to_s
  "[Native #{@ruby.class.name}]"
end

#unwrapObject



11
12
13
# File 'lib/rhino/ruby_object.rb', line 11

def unwrap
  @ruby
end