Class: Remocon::BooleanNormalizer
Instance Attribute Summary
Attributes inherited from Normalizer
#content
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Normalizer
#initialize, #process
Class Method Details
.respond_symbol ⇒ Object
5
6
7
|
# File 'lib/remocon/normalizer/boolean_normalizer.rb', line 5
def self.respond_symbol
Remocon::Type::BOOLEAN
end
|
Instance Method Details
#normalize ⇒ Object
15
16
17
|
# File 'lib/remocon/normalizer/boolean_normalizer.rb', line 15
def normalize
@bool_val
end
|
#validate ⇒ Object
9
10
11
12
13
|
# File 'lib/remocon/normalizer/boolean_normalizer.rb', line 9
def validate
@bool_val = @content.to_s.to_boolean
rescue ArgumentError => e
raise ValidationError, e.message
end
|