Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio-standards/btap/btap.rb

Instance Method Summary collapse

Instance Method Details

#to_boolObject

This method converts to Boolean.

Raises:

  • (ArgumentError)

Author:



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