Class: Yoda::Model::LexicalContext
- Inherits:
-
Object
- Object
- Yoda::Model::LexicalContext
- Includes:
- Enumerable
- Defined in:
- lib/yoda/model/lexical_context.rb
Instance Attribute Summary collapse
- #paths ⇒ Array<Path> readonly
Class Method Summary collapse
Instance Method Summary collapse
- #==(another) ⇒ Object
- #each(&block) ⇒ Object
- #eql?(another) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(paths:) ⇒ LexicalContext
constructor
A new instance of LexicalContext.
- #to_rbs_context ⇒ Array<RBS::Namespace>
Constructor Details
#initialize(paths:) ⇒ LexicalContext
Returns a new instance of LexicalContext.
14 15 16 |
# File 'lib/yoda/model/lexical_context.rb', line 14 def initialize(paths:) @paths = paths end |
Instance Attribute Details
#paths ⇒ Array<Path> (readonly)
7 8 9 |
# File 'lib/yoda/model/lexical_context.rb', line 7 def paths @paths end |
Class Method Details
Instance Method Details
#==(another) ⇒ Object
27 28 29 |
# File 'lib/yoda/model/lexical_context.rb', line 27 def ==(another) eql?(another) end |
#each(&block) ⇒ Object
23 24 25 |
# File 'lib/yoda/model/lexical_context.rb', line 23 def each(&block) paths.each(&block) end |
#eql?(another) ⇒ Boolean
31 32 33 |
# File 'lib/yoda/model/lexical_context.rb', line 31 def eql?(another) another.is_a?(LexicalContext) && paths == another.paths end |
#hash ⇒ Object
35 36 37 |
# File 'lib/yoda/model/lexical_context.rb', line 35 def hash paths.hash end |
#to_rbs_context ⇒ Array<RBS::Namespace>
19 20 21 |
# File 'lib/yoda/model/lexical_context.rb', line 19 def to_rbs_context paths.map { |path| Namespace(path.to_s) } end |