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