Class: Pragma::Filter::Where
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
Attributes inherited from Base
Instance Method Summary collapse
- #apply(relation:, value:) ⇒ Object
-
#initialize(condition:, **other) ⇒ Where
constructor
A new instance of Where.
Constructor Details
#initialize(condition:, **other) ⇒ Where
Returns a new instance of Where.
8 9 10 11 |
# File 'lib/pragma/filter/where.rb', line 8 def initialize(condition:, **other) super(**other) @condition = condition end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
6 7 8 |
# File 'lib/pragma/filter/where.rb', line 6 def condition @condition end |
Instance Method Details
#apply(relation:, value:) ⇒ Object
13 14 15 |
# File 'lib/pragma/filter/where.rb', line 13 def apply(relation:, value:) relation.where(condition, value: value) end |