Class: MetaWhere::Condition
- Inherits:
-
Object
- Object
- MetaWhere::Condition
- Includes:
- ConditionOperators, Utility
- Defined in:
- lib/meta_where/condition.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other_condition) ⇒ Object (also: #eql?)
-
#initialize(column, value, method) ⇒ Condition
constructor
A new instance of Condition.
-
#to_sym ⇒ Object
Play “nicely” with expand_hash_conditions_for_aggregates.
Methods included from ConditionOperators
Constructor Details
#initialize(column, value, method) ⇒ Condition
Returns a new instance of Condition.
11 12 13 14 15 |
# File 'lib/meta_where/condition.rb', line 11 def initialize(column, value, method) @column = column @value = value @method = (MetaWhere::METHOD_ALIASES[method.to_s] || method).to_s end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
9 10 11 |
# File 'lib/meta_where/condition.rb', line 9 def column @column end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
9 10 11 |
# File 'lib/meta_where/condition.rb', line 9 def method @method end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'lib/meta_where/condition.rb', line 9 def value @value end |
Instance Method Details
#==(other_condition) ⇒ Object Also known as: eql?
17 18 19 20 21 22 |
# File 'lib/meta_where/condition.rb', line 17 def ==(other_condition) other_condition.is_a?(Condition) && other_condition.column == column && other_condition.value == value && other_condition.method == method end |
#to_sym ⇒ Object
Play “nicely” with expand_hash_conditions_for_aggregates
27 28 29 |
# File 'lib/meta_where/condition.rb', line 27 def to_sym self end |