Class: ActiveModel::Relation::WhereClause::BlockPredicate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Predicate

#invert

Constructor Details

#initialize(block) ⇒ BlockPredicate

Returns a new instance of BlockPredicate.



34
35
36
37
38
# File 'lib/active_model/relation/where_clause.rb', line 34

def initialize(block)
  super()

  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



32
33
34
# File 'lib/active_model/relation/where_clause.rb', line 32

def block
  @block
end

Instance Method Details

#call(record) ⇒ Object



40
41
42
# File 'lib/active_model/relation/where_clause.rb', line 40

def call(record)
  block.call(record)
end