Class: Zaid::Runtime::ZaidObject

Inherits:
Object
  • Object
show all
Defined in:
lib/zaid/runtime/zaid_object.rb

Direct Known Subclasses

ZaidClass

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime_class, ruby_value = self) ⇒ ZaidObject

Returns a new instance of ZaidObject.



8
9
10
11
# File 'lib/zaid/runtime/zaid_object.rb', line 8

def initialize(runtime_class, ruby_value = self)
  @runtime_class = runtime_class
  @ruby_value = ruby_value
end

Instance Attribute Details

#ruby_valueObject

Returns the value of attribute ruby_value.



6
7
8
# File 'lib/zaid/runtime/zaid_object.rb', line 6

def ruby_value
  @ruby_value
end

#runtime_classObject

Returns the value of attribute runtime_class.



6
7
8
# File 'lib/zaid/runtime/zaid_object.rb', line 6

def runtime_class
  @runtime_class
end

Instance Method Details

#call(method_name, arguments = []) ⇒ Object



13
14
15
# File 'lib/zaid/runtime/zaid_object.rb', line 13

def call(method_name, arguments = [])
  @runtime_class.lookup(method_name).call(self, arguments)
end