Class: HashyValueValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/hashy_validator/hashy_value_validator.rb

Instance Method Summary collapse

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_validObject



13
14
15
# File 'lib/hashy_validator/hashy_value_validator.rb', line 13

def is_valid
  @valid
end

#reasonObject



21
22
23
# File 'lib/hashy_validator/hashy_value_validator.rb', line 21

def reason
  @reason
end

#valueObject



17
18
19
# File 'lib/hashy_validator/hashy_value_validator.rb', line 17

def value
  @value
end