Sha256: 695673fde7929491217bf0f1a1bbc7d12e653e065ced6649ca0ed0403cff7b3b

Contents?: true

Size: 268 Bytes

Versions: 1

Compression:

Stored size: 268 Bytes

Contents

class String
  def anticapitalize
    self.empty? ? self.clone : (self[0].downcase + self[1..-1])
  end

  def underscore
    self.gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    tr("-", "_").
    downcase
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
my_chart-0.1.3 lib/my_chart/helper/string.rb