Class: Daedal::Attributes::Operator
- Inherits:
-
Virtus::Attribute
- Object
- Virtus::Attribute
- Daedal::Attributes::Operator
- Defined in:
- lib/daedal/attributes/operator.rb
Constant Summary collapse
- ALLOWED_MATCH_OPERATORS =
[:or, :and]
Instance Method Summary collapse
Instance Method Details
#coerce(value) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/daedal/attributes/operator.rb', line 6 def coerce(value) unless value.nil? value = value.to_sym unless ALLOWED_MATCH_OPERATORS.include? value raise Virtus::CoercionError.new(value, 'Daedal::Attributes::Operator') end end value end |