Class: EasyJSONMatcher::ValidationRule
- Inherits:
-
Object
- Object
- EasyJSONMatcher::ValidationRule
- Defined in:
- lib/easy_json_matcher/validation_rules.rb
Instance Attribute Summary collapse
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #call(value, errors) ⇒ Object
-
#initialize(type, rule) ⇒ ValidationRule
constructor
A new instance of ValidationRule.
Constructor Details
#initialize(type, rule) ⇒ ValidationRule
Returns a new instance of ValidationRule.
7 8 9 10 |
# File 'lib/easy_json_matcher/validation_rules.rb', line 7 def initialize(type, rule) @type = type @rule = rule end |
Instance Attribute Details
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
5 6 7 |
# File 'lib/easy_json_matcher/validation_rules.rb', line 5 def rule @rule end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/easy_json_matcher/validation_rules.rb', line 5 def type @type end |
Instance Method Details
#call(value, errors) ⇒ Object
12 13 14 |
# File 'lib/easy_json_matcher/validation_rules.rb', line 12 def call(value, errors) rule.call(value, errors) end |