Class: ActiveModel::Relation::WhereClause::BlockPredicate
- Defined in:
- lib/active_model/relation/where_clause.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #call(record) ⇒ Object
-
#initialize(block) ⇒ BlockPredicate
constructor
A new instance of BlockPredicate.
Methods inherited from Predicate
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
#block ⇒ Object (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 |