Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/openstudio-standards/btap/btap.rb
Overview
require_relative ‘btap.model’
Instance Method Summary collapse
-
#to_bool ⇒ Object
This method converts to Boolean.
Instance Method Details
#to_bool ⇒ Object
This method converts to Boolean.
49 50 51 52 53 |
# File 'lib/openstudio-standards/btap/btap.rb', line 49 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 |