Class: ActiveModel::Relation::WhereClause::NotPredicate
- Defined in:
- lib/active_model/relation/where_clause.rb
Instance Attribute Summary collapse
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
Instance Method Summary collapse
- #call(record) ⇒ Object
-
#initialize(predicate) ⇒ NotPredicate
constructor
A new instance of NotPredicate.
- #invert ⇒ Object
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
#predicate ⇒ Object (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 |
#invert ⇒ Object
58 59 60 |
# File 'lib/active_model/relation/where_clause.rb', line 58 def invert predicate end |