Class: String
Instance Method Summary collapse
Instance Method Details
#to_b ⇒ Object
2 3 4 5 6 |
# File 'lib/gooddata/extensions/string.rb', line 2 def to_b return true if self == true || self =~ (/(true|t|yes|y|1)$/i) return false if self == false || blank? || self =~ (/(false|f|no|n|0)$/i) raise ArgumentError, "invalid value for Boolean: \"#{self}\"" end |