Class: SpectatorSport::SearchQuery::SyntaxTree::Not

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#nodeObject (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_scopeObject



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