Class: RVM::Classes::Object
Instance Attribute Summary collapse
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#object_class ⇒ Object
readonly
Returns the value of attribute object_class.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
- #data_type ⇒ Object
-
#initialize(objectClass) ⇒ Object
constructor
A new instance of Object.
- #obj_send(method, params, env) ⇒ Object
Methods inherited from Class
#is_true?, #method_missing, #method_missing_old_class
Methods included from Plugin
#helper, #included, #plugin_host, #plugin_id, #register_for
Constructor Details
#initialize(objectClass) ⇒ Object
Returns a new instance of Object.
9 10 11 12 13 14 15 |
# File 'lib/rvm/classes/object.rb', line 9 def initialize objectClass super() @object_class = objectClass @functions = {} @variables = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RVM::Classes::Class
Instance Attribute Details
#functions ⇒ Object (readonly)
Returns the value of attribute functions.
5 6 7 |
# File 'lib/rvm/classes/object.rb', line 5 def functions @functions end |
#object_class ⇒ Object (readonly)
Returns the value of attribute object_class.
7 8 9 |
# File 'lib/rvm/classes/object.rb', line 7 def object_class @object_class end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
6 7 8 |
# File 'lib/rvm/classes/object.rb', line 6 def variables @variables end |
Instance Method Details
#data_type ⇒ Object
25 26 27 |
# File 'lib/rvm/classes/object.rb', line 25 def data_type :object end |
#obj_send(method, params, env) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/rvm/classes/object.rb', line 17 def obj_send(method, params, env) m = @functions[method] || @object_class.object_functions(method) raise "Unknown method #{method} for object #{self}" if not m params.unshift self env = RVM::Interpreter::Enviroment.new({:params => params||[], :locals => @variables}, env) m.call(params, env) end |