Class: EleetScript::ClassInstanceContext
- Inherits:
-
BaseContext
- Object
- BaseContext
- EleetScript::ClassInstanceContext
- Defined in:
- lib/lang/runtime/context.rb
Instance Attribute Summary collapse
-
#ns_context ⇒ Object
Returns the value of attribute ns_context.
Attributes inherited from BaseContext
#constants, #current_self, #global_vars, #namespaces
Instance Method Summary collapse
- #[](key) ⇒ Object
- #current_class ⇒ Object
- #local_vars ⇒ Object
- #namespace_context ⇒ Object
- #new_method_context(name, lambda_context = nil) ⇒ Object
Methods inherited from BaseContext
#[]=, #class_vars, #es_nil, init_with, #initialize, #instance_vars, #local_constant, #local_var, #method_missing, #respond_to_missing?, #root_ns
Constructor Details
This class inherits a constructor from EleetScript::BaseContext
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class EleetScript::BaseContext
Instance Attribute Details
#ns_context ⇒ Object
Returns the value of attribute ns_context.
243 244 245 |
# File 'lib/lang/runtime/context.rb', line 243 def ns_context @ns_context end |
Instance Method Details
#[](key) ⇒ Object
254 255 256 257 258 259 260 261 |
# File 'lib/lang/runtime/context.rb', line 254 def [](key) value = ns_context[key] if value == es_nil super else value end end |
#current_class ⇒ Object
246 247 248 |
# File 'lib/lang/runtime/context.rb', line 246 def current_class @parent_context.current_class end |
#local_vars ⇒ Object
250 251 252 |
# File 'lib/lang/runtime/context.rb', line 250 def local_vars {} end |
#namespace_context ⇒ Object
263 264 265 |
# File 'lib/lang/runtime/context.rb', line 263 def namespace_context ns_context end |
#new_method_context(name, lambda_context = nil) ⇒ Object
267 268 269 270 271 |
# File 'lib/lang/runtime/context.rb', line 267 def new_method_context(name, lambda_context = nil) MethodContext.new(current_self, current_class, name, lambda_context).tap do |ctx| ctx.parent_context = self end end |