Sha256: 85f9dd8205826803d14b10a0f1ea929a4e52e6dbdf942eb65cb054d2b25fa02d

Contents?: true

Size: 136 Bytes

Versions: 1

Compression:

Stored size: 136 Bytes

Contents

class String
  # casts to an integer if applicable,
  # else leaves it alone.
  def to_i?
    Integer(self)
  rescue
    self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
modesty-0.1.0 lib/modesty/core_ext/string.rb