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, #bound_class, #count, #first, #inspect, #list, #to_criteria, #to_hash, #to_s, #|

Constructor Details

#initialize(c) ⇒ NotCriterion

Returns a new instance of NotCriterion.



598
599
600
# File 'lib/criteria.rb', line 598

def initialize(c)
  @criterion = c
end

Instance Attribute Details

#criterionObject

Returns the value of attribute criterion.



597
598
599
# File 'lib/criteria.rb', line 597

def criterion
  @criterion
end

Instance Method Details

#columnsObject



606
607
608
# File 'lib/criteria.rb', line 606

def columns
  @criterion.colums
end

#notObject



602
603
604
# File 'lib/criteria.rb', line 602

def not
  @criterion
end

#to_where_sqlObject



610
611
612
# File 'lib/criteria.rb', line 610

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