Class: Yoda::Typing::Contexts::NamespaceBlockContext

Inherits:
BaseContext
  • Object
show all
Defined in:
lib/yoda/typing/contexts/namespace_block_context.rb

Overview

Block context which has its lexical scope (for instance_eval and instance_exec)

Instance Attribute Summary collapse

Attributes inherited from BaseContext

#constant_ref, #environment, #parent, #receiver, #type_binding

Instance Method Summary collapse

Methods inherited from BaseContext

#constant_resolver, #generator, #lexical_scope_types, #method_receiver, #registry

Methods included from ContextDerivation

#constant_ref, #derive_block_context, #derive_class_context, #derive_method_context, #environment, #receiver

Constructor Details

#initialize(objects:, **kwargs) ⇒ NamespaceBlockContext

Returns a new instance of NamespaceBlockContext.

Parameters:



12
13
14
15
# File 'lib/yoda/typing/contexts/namespace_block_context.rb', line 12

def initialize(objects:, **kwargs)
  @objects = objects
  super(**kwargs)
end

Instance Attribute Details

#objectsStore::Objects::NamespaceObject (readonly)



9
10
11
# File 'lib/yoda/typing/contexts/namespace_block_context.rb', line 9

def objects
  @objects
end

Instance Method Details

#current_objectsArray<Store::Objects::NamespaceObject>



18
19
20
# File 'lib/yoda/typing/contexts/namespace_block_context.rb', line 18

def current_objects
  objects
end

#parent_variable_scope_contextContext?

Returns:

  • (Context, nil)


23
24
25
# File 'lib/yoda/typing/contexts/namespace_block_context.rb', line 23

def parent_variable_scope_context
  parent
end