Class: Amsi::AttributeParser::Boolean
- Defined in:
- lib/amsi/attribute_parser/boolean.rb
Overview
Parse the response value of a boolean attribute
Instance Method Summary collapse
-
#parse ⇒ true|false
The parsed attribute value.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Amsi::AttributeParser::Base
Instance Method Details
#parse ⇒ true|false
Returns the parsed attribute value.
18 19 20 21 22 23 |
# File 'lib/amsi/attribute_parser/boolean.rb', line 18 def parse return true if TRUE_VALUES.include?(value) return false if FALSE_VALUES.include?(value) raise Error::InvalidResponse, "Invalid boolean response value: #{value}" end |