Class: SpectatorSport::SearchQuery::SyntaxTree::Not
- Inherits:
-
Object
- Object
- SpectatorSport::SearchQuery::SyntaxTree::Not
- Defined in:
- app/models/spectator_sport/search_query/syntax_tree.rb
Overview
Node: recordings that do NOT match the wrapped node.
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(node) ⇒ Not
constructor
A new instance of Not.
- #to_scope ⇒ Object
Constructor Details
#initialize(node) ⇒ Not
Returns a new instance of Not.
93 94 95 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 93 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
91 92 93 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 91 def node @node end |
Instance Method Details
#==(other) ⇒ Object
101 102 103 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 101 def ==(other) other.is_a?(self.class) && other.node == node end |
#to_scope ⇒ Object
97 98 99 |
# File 'app/models/spectator_sport/search_query/syntax_tree.rb', line 97 def to_scope SpectatorSport::Recording.where.not(id: node.to_scope.select(:id)) end |