Class: Yoda::Typing::LexicalScope
- Inherits:
-
Object
- Object
- Yoda::Typing::LexicalScope
- Defined in:
- lib/yoda/typing/lexical_scope.rb
Instance Attribute Summary collapse
- #ancestor_paths ⇒ Array<Path> readonly
- #namespace ⇒ Store::Objects::Base readonly
Instance Method Summary collapse
- #find_constant(registry, constant_name) ⇒ Store::Objects::Base?
-
#initialize(namespace, ancestor_paths) ⇒ LexicalScope
constructor
A new instance of LexicalScope.
Constructor Details
#initialize(namespace, ancestor_paths) ⇒ LexicalScope
Returns a new instance of LexicalScope.
12 13 14 15 |
# File 'lib/yoda/typing/lexical_scope.rb', line 12 def initialize(namespace, ancestor_paths) @namespace = namespace @ancestor_paths = ancestor_paths end |
Instance Attribute Details
#ancestor_paths ⇒ Array<Path> (readonly)
8 9 10 |
# File 'lib/yoda/typing/lexical_scope.rb', line 8 def ancestor_paths @ancestor_paths end |
#namespace ⇒ Store::Objects::Base (readonly)
5 6 7 |
# File 'lib/yoda/typing/lexical_scope.rb', line 5 def namespace @namespace end |
Instance Method Details
#find_constant(registry, constant_name) ⇒ Store::Objects::Base?
20 21 22 23 |
# File 'lib/yoda/typing/lexical_scope.rb', line 20 def find_constant(registry, constant_name) scoped_path = Model::ScopedPath.new(ancestor_paths, constant_name) Store::Query::FindConstant.new(registry).find(scoped_path) end |