Sha256: 0eb4e2182db65eabf6e78de8ce4ccb884cdc52f543fd71721ab207f1929fb683

Contents?: true

Size: 266 Bytes

Versions: 5

Compression:

Stored size: 266 Bytes

Contents

class String

  def to_boolean
    ['true', 1, '1', 'yes', 't', 'y'].include?(downcase)
  end

end

class NilClass

  def to_boolean
    false
  end

end

class FalseClass

  def to_boolean
    false
  end

end

class TrueClass

  def to_boolean
    true
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
symphonia-5.0.6 lib/symphonia/object.rb
symphonia-5.0.5 lib/symphonia/object.rb
symphonia-5.0.4 lib/symphonia/object.rb
symphonia-5.0.3 lib/symphonia/object.rb
symphonia-5.0.0 lib/symphonia/object.rb