Class: AttrSearchableGrammar::BaseNode
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- AttrSearchableGrammar::BaseNode
show all
- Defined in:
- lib/attr_searchable_grammar.rb
Direct Known Subclasses
AndExpression, AnywhereExpression, Column, ComparativeExpression, ComplexExpression, DoubleQuotedValue, NotExpression, OrExpression, ParenthesesExpression, SingleQuotedValue, Value
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#model ⇒ Object
9
10
11
|
# File 'lib/attr_searchable_grammar.rb', line 9
def model
@model || parent.model
end
|
Instance Method Details
#collection_for(key) ⇒ Object
#elements ⇒ Object
17
18
19
|
# File 'lib/attr_searchable_grammar.rb', line 17
def elements
super.select { |element| element.class != Treetop::Runtime::SyntaxNode }
end
|
#evaluate ⇒ Object
13
14
15
|
# File 'lib/attr_searchable_grammar.rb', line 13
def evaluate
elements.collect(&:evaluate).inject(:and)
end
|