Class: HashObject::BooleanConverter
- Inherits:
-
Object
- Object
- HashObject::BooleanConverter
- Defined in:
- lib/hash_object.rb
Overview
We need to convert strange elements into boolean values. This is a convenience class for that purpose.
Class Method Summary collapse
-
.parse(element) ⇒ Boolean
Parses the current element into a boolean value.
Class Method Details
.parse(element) ⇒ Boolean
Parses the current element into a boolean value.
19 20 21 22 23 24 25 |
# File 'lib/hash_object.rb', line 19 def self.parse(element) if element == 'false' || element == 0 false else !!element end end |