Class: String

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

Overview

require_relative ‘btap.model’

Instance Method Summary collapse

Instance Method Details

#to_boolObject

This method converts to Boolean.

Raises:

  • (ArgumentError)

Author:



48
49
50
51
52
# File 'lib/openstudio-standards/btap/btap.rb', line 48

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