Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/openstudio-standards/btap/btap.rb
Instance Method Summary collapse
-
#to_bool ⇒ Object
This method converts to Boolean.
Instance Method Details
#to_bool ⇒ Object
This method converts to Boolean.
47 48 49 50 51 |
# File 'lib/openstudio-standards/btap/btap.rb', line 47 def to_bool return true if self == true || self =~ (/^(true|t|yes|y|1)$/i) return false if self == false || self =~ (/^(false|f|no|n|0)$/i) raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end |