Method: EleetScript::PropertyNode#eval
- Defined in:
- lib/lang/interpreter.rb
#eval(context) ⇒ Object
293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/lang/interpreter.rb', line 293 def eval(context) cls = context.current_class properties.each do |prop_name| cls.def "#{prop_name}=" do |receiver, arguments| receiver.instance_vars[prop_name] = arguments.first end cls.def prop_name do |receiver, arguments| receiver.instance_vars[prop_name] end end end |