Class: ParamsReady::Query::Not

Inherits:
Object
  • Object
show all
Defined in:
lib/params_ready/query/predicate_operator.rb

Instance Method Summary collapse

Constructor Details

#initialize(operator) ⇒ Not

Returns a new instance of Not.



109
110
111
# File 'lib/params_ready/query/predicate_operator.rb', line 109

def initialize(operator)
  @operator = operator
end

Instance Method Details

#altnObject



117
118
119
# File 'lib/params_ready/query/predicate_operator.rb', line 117

def altn
  "n#{@operator.altn}"
end

#nameObject



113
114
115
# File 'lib/params_ready/query/predicate_operator.rb', line 113

def name
  "not_#{@operator.name}"
end

#test(*args) ⇒ Object



121
122
123
124
# File 'lib/params_ready/query/predicate_operator.rb', line 121

def test(*args)
  result = @operator.test *args
  !result
end

#to_query(*args) ⇒ Object



126
127
128
129
# File 'lib/params_ready/query/predicate_operator.rb', line 126

def to_query(*args)
  result = @operator.to_query(*args)
  result.not
end