Class: Aequitas::Rule::Value::Range
- Inherits:
-
Aequitas::Rule::Value
- Object
- Aequitas::Rule
- Aequitas::Rule::Value
- Aequitas::Rule::Value::Range
- Defined in:
- lib/aequitas/rule/value/range.rb
Instance Attribute Summary
Attributes inherited from Aequitas::Rule
#attribute_name, #custom_message, #guard, #skip_condition
Attributes included from ValueObject
Instance Method Summary collapse
- #valid_value?(value) ⇒ Boolean
- #violation_data(resource) ⇒ Object
- #violation_type(resource) ⇒ Object
Methods inherited from Aequitas::Rule::Value
#expected, #initialize, rules_for, #valid?
Methods inherited from Aequitas::Rule
#attribute_value, #execute?, #initialize, rules_for, #skip?, #validate, #violation_info, #violation_values
Methods included from ValueObject
Constructor Details
This class inherits a constructor from Aequitas::Rule::Value
Instance Method Details
#valid_value?(value) ⇒ Boolean
10 11 12 |
# File 'lib/aequitas/rule/value/range.rb', line 10 def valid_value?(value) expected.cover?(value) end |
#violation_data(resource) ⇒ Object
18 19 20 |
# File 'lib/aequitas/rule/value/range.rb', line 18 def violation_data(resource) [ [ :minimum, expected.begin ], [ :maximum, expected.end ] ] end |
#violation_type(resource) ⇒ Object
14 15 16 |
# File 'lib/aequitas/rule/value/range.rb', line 14 def violation_type(resource) :value_between end |