Class: SpectatorSport::SearchQuery::SyntaxTree::And
- Inherits:
-
Object
- Object
- SpectatorSport::SearchQuery::SyntaxTree::And
- Defined in:
- app/models/spectator_sport/search_query/syntax_tree.rb
Overview
Branch node: both sides must match (possibly different labels on the same recording).
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) ⇒ And
constructor
A new instance of And.
- #to_scope ⇒ Object
Constructor Details
#initialize(left, right) ⇒ And
Returns a new instance of And.
57 58 59 60 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 57 def initialize(left, right) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
55 56 57 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 55 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
55 56 57 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 55 def right @right end |
Instance Method Details
#==(other) ⇒ Object
66 67 68 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 66 def ==(other) other.is_a?(self.class) && other.left == left && other.right == right end |
#to_scope ⇒ Object
62 63 64 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 62 def to_scope left.to_scope.where(id: right.to_scope.select(:id)) end |