Class: Yoda::Parsing::Traverser::ResultSet
- Inherits:
-
Object
- Object
- Yoda::Parsing::Traverser::ResultSet
show all
- Extended by:
- Forwardable
- Includes:
- Enumerable, QueryInterface
- Defined in:
- lib/yoda/parsing/traverser/result_set.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#query, #query_all, #query_ancestor, #query_ancestors
Constructor Details
#initialize(nodes) ⇒ ResultSet
Returns a new instance of ResultSet.
16
17
18
|
# File 'lib/yoda/parsing/traverser/result_set.rb', line 16
def initialize(nodes)
@nodes = nodes
end
|
Instance Attribute Details
#nodes ⇒ Enumerable<AST::Node>
12
13
14
|
# File 'lib/yoda/parsing/traverser/result_set.rb', line 12
def nodes
@nodes
end
|
Instance Method Details
#all_nodes ⇒ Enumerable<AST::Node>
21
22
23
|
# File 'lib/yoda/parsing/traverser/result_set.rb', line 21
def all_nodes
flat_map(&method(:all_nodes_for))
end
|
#nesting ⇒ Enumerable<AST::Node>
26
27
28
|
# File 'lib/yoda/parsing/traverser/result_set.rb', line 26
def nesting
flat_map(&method(:nesting))
end
|
31
32
33
|
# File 'lib/yoda/parsing/traverser/result_set.rb', line 31
def to_a
nodes.to_a
end
|