Class: Sol::RBObject
- Inherits:
-
Object
- Object
- Sol::RBObject
- Defined in:
- lib/jx/rbobject.rb
Instance Attribute Summary collapse
-
#jsvalue ⇒ Object
readonly
Returns the value of attribute jsvalue.
-
#native(*args) ⇒ Object
readonly
————————————————————————————.
-
#ruby_obj ⇒ Object
readonly
Returns the value of attribute ruby_obj.
Instance Method Summary collapse
-
#initialize(jsvalue, ruby_obj, native) ⇒ RBObject
constructor
————————————————————————————.
-
#method_missing(symbol, *args, &blk) ⇒ Object
————————————————————————————.
-
#typeof ⇒ Object
————————————————————————————.
Constructor Details
#initialize(jsvalue, ruby_obj, native) ⇒ RBObject
40 41 42 43 44 |
# File 'lib/jx/rbobject.rb', line 40 def initialize(jsvalue, ruby_obj, native) @jsvalue = jsvalue @ruby_obj = ruby_obj @native = native end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args, &blk) ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/jx/rbobject.rb', line 58 def method_missing(symbol, *args, &blk) begin @ruby_obj.send(symbol, *args, &blk) rescue TypeError args[0].native(symbol, @ruby_obj, &blk) end end |
Instance Attribute Details
#jsvalue ⇒ Object (readonly)
Returns the value of attribute jsvalue.
32 33 34 |
# File 'lib/jx/rbobject.rb', line 32 def jsvalue @jsvalue end |
#native(*args) ⇒ Object (readonly)
72 73 74 |
# File 'lib/jx/rbobject.rb', line 72 def native @native end |
#ruby_obj ⇒ Object (readonly)
Returns the value of attribute ruby_obj.
33 34 35 |
# File 'lib/jx/rbobject.rb', line 33 def ruby_obj @ruby_obj end |
Instance Method Details
#typeof ⇒ Object
50 51 52 |
# File 'lib/jx/rbobject.rb', line 50 def typeof B.push("object") end |