Sha256: 56054807da218357a65cfbed4f81c9aeaf4ae6dd216f5bf512103afa02e6ba6a

Contents?: true

Size: 245 Bytes

Versions: 6

Compression:

Stored size: 245 Bytes

Contents

class String
  def to_val
    if self =~ /\A[-+]?\d+$/
      Integer( self )
    elsif self =~ /\A[-+]?\d+\.\d+$/
      Float( self )
    elsif self =~ /false/
      false
    elsif self =~ /true/
      true
    else
      self
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
bigbertha-0.0.5 lib/bigbertha/core_ext/string.rb
bigbertha-0.0.4 lib/bigbertha/core_ext/string.rb
bigbertha-0.0.2 lib/bigbertha/core_ext/string.rb
bigbertha-0.0.1 lib/bigbertha/core_ext/string.rb
basilik-0.0.2 lib/basilik/core_ext/string.rb
basilik-0.0.1 lib/basilik/core_ext/string.rb