Class: Criteria::NotCriterion

Inherits:
Criterion show all
Defined in:
lib/criteria.rb

Constant Summary

Constants inherited from Criterion

Criterion::EQUAL, Criterion::GREATER_THAN, Criterion::GREATER_THAN_OR_EQUAL, Criterion::IN, Criterion::LESS_THAN, Criterion::LESS_THAN_OR_EQUAL, Criterion::NOT_EQUAL, Criterion::NOT_IN

Instance Attribute Summary collapse

Attributes inherited from Criterion

#column, #operator, #value

Instance Method Summary collapse

Methods inherited from Criterion

#&, #associations, #to_hash, #to_s, #|

Constructor Details

#initialize(c) ⇒ NotCriterion

Returns a new instance of NotCriterion.



490
491
492
# File 'lib/criteria.rb', line 490

def initialize(c)
  @criterion = c
end

Instance Attribute Details

#criterionObject

Returns the value of attribute criterion.



489
490
491
# File 'lib/criteria.rb', line 489

def criterion
  @criterion
end

Instance Method Details

#columnsObject



498
499
500
# File 'lib/criteria.rb', line 498

def columns
  @criterion.colums
end

#notObject



494
495
496
# File 'lib/criteria.rb', line 494

def not
  @criterion
end

#to_where_sqlObject



502
503
504
# File 'lib/criteria.rb', line 502

def to_where_sql 
  "NOT (#{@criterion.to_where_sql})"
end