Class: ActiveModel::Relation::WhereClause::NotPredicate

Inherits:
Predicate
  • Object
show all
Defined in:
lib/active_model/relation/where_clause.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predicate) ⇒ NotPredicate

Returns a new instance of NotPredicate.



48
49
50
51
52
# File 'lib/active_model/relation/where_clause.rb', line 48

def initialize(predicate)
  super()

  @predicate = predicate
end

Instance Attribute Details

#predicateObject (readonly)

Returns the value of attribute predicate.



46
47
48
# File 'lib/active_model/relation/where_clause.rb', line 46

def predicate
  @predicate
end

Instance Method Details

#call(record) ⇒ Object



54
55
56
# File 'lib/active_model/relation/where_clause.rb', line 54

def call(record)
  !predicate.call(record)
end

#invertObject



58
59
60
# File 'lib/active_model/relation/where_clause.rb', line 58

def invert
  predicate
end