Class: SpectatorSport::SearchQuery::SyntaxTree::Or
- Inherits:
-
Object
- Object
- SpectatorSport::SearchQuery::SyntaxTree::Or
- Defined in:
- app/models/spectator_sport/search_query/syntax_tree.rb
Overview
Branch node: either side may match.
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(left, right) ⇒ Or
constructor
A new instance of Or.
- #to_scope ⇒ Object
Constructor Details
#initialize(left, right) ⇒ Or
Returns a new instance of Or.
75 76 77 78 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 75 def initialize(left, right) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
73 74 75 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 73 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
73 74 75 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 73 def right @right end |
Instance Method Details
#==(other) ⇒ Object
84 85 86 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 84 def ==(other) other.is_a?(self.class) && other.left == left && other.right == right end |
#to_scope ⇒ Object
80 81 82 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 80 def to_scope left.to_scope.or(right.to_scope) end |