Class: Triggerable::Conditions::FieldCondition
- Inherits:
-
Condition
- Object
- Condition
- Triggerable::Conditions::FieldCondition
show all
- Defined in:
- lib/triggerable/conditions/field/field_condition.rb
Instance Method Summary
collapse
Methods inherited from Condition
build
Constructor Details
Returns a new instance of FieldCondition.
4
5
6
7
|
# File 'lib/triggerable/conditions/field/field_condition.rb', line 4
def initialize field, value
@field = field
@value = value
end
|
Instance Method Details
#desc ⇒ Object
17
18
19
|
# File 'lib/triggerable/conditions/field/field_condition.rb', line 17
def desc
"#{@field} #{@ruby_comparator} #{@value}"
end
|
#scope(table) ⇒ Object
13
14
15
|
# File 'lib/triggerable/conditions/field/field_condition.rb', line 13
def scope table
table[@field].send(@db_comparator, @value)
end
|
#true_for?(object) ⇒ Boolean
9
10
11
|
# File 'lib/triggerable/conditions/field/field_condition.rb', line 9
def true_for? object
field_value(object).send(@ruby_comparator, @value)
end
|