Sha256: 5438604e57eb06cd7e4db9e261ac5939fbf2d36a0a38b6d198ba56834f1067d3

Contents?: true

Size: 244 Bytes

Versions: 25

Compression:

Stored size: 244 Bytes

Contents

class String
  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
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
gooddata-1.3.0-java lib/gooddata/extensions/string.rb
gooddata-1.3.0 lib/gooddata/extensions/string.rb
gooddata-1.2.1-java lib/gooddata/extensions/string.rb
gooddata-1.2.1 lib/gooddata/extensions/string.rb
gooddata-1.2.0-java lib/gooddata/extensions/string.rb
gooddata-1.2.0 lib/gooddata/extensions/string.rb
gooddata-1.1.0-java lib/gooddata/extensions/string.rb
gooddata-1.1.0 lib/gooddata/extensions/string.rb
gooddata-1.0.2-java lib/gooddata/extensions/string.rb
gooddata-1.0.2 lib/gooddata/extensions/string.rb
gooddata-1.0.1 lib/gooddata/extensions/string.rb
gooddata-1.0.1-java lib/gooddata/extensions/string.rb
gooddata-1.0.0-java lib/gooddata/extensions/string.rb
gooddata-1.0.0 lib/gooddata/extensions/string.rb
gooddata-0.6.54 lib/gooddata/extensions/string.rb
gooddata-0.6.53 lib/gooddata/extensions/string.rb
gooddata-0.6.52 lib/gooddata/extensions/string.rb
gooddata-0.6.51 lib/gooddata/extensions/string.rb
gooddata-0.6.50 lib/gooddata/extensions/string.rb
gooddata-0.6.49 lib/gooddata/extensions/string.rb