Class: HashyValueValidator
- Inherits:
-
Object
- Object
- HashyValueValidator
- Defined in:
- lib/hashy_validator/hashy_value_validator.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ HashyValueValidator
constructor
A new instance of HashyValueValidator.
- #is_valid ⇒ Object
- #reason ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(value) ⇒ HashyValueValidator
Returns a new instance of HashyValueValidator.
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/hashy_validator/hashy_value_validator.rb', line 2 def initialize(value) @value = value.blank? ? [] : value @valid = true @reason = nil check_parse_value check_is_array @value end |
Instance Method Details
#is_valid ⇒ Object
13 14 15 |
# File 'lib/hashy_validator/hashy_value_validator.rb', line 13 def is_valid @valid end |
#reason ⇒ Object
21 22 23 |
# File 'lib/hashy_validator/hashy_value_validator.rb', line 21 def reason @reason end |
#value ⇒ Object
17 18 19 |
# File 'lib/hashy_validator/hashy_value_validator.rb', line 17 def value @value end |