Sha256: 9550f6b531c49d3c59fd320850134a412a1f55c2935c7da33d4b6b6a3814901d

Contents?: true

Size: 132 Bytes

Versions: 10

Compression:

Stored size: 132 Bytes

Contents

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
qcourses-0.1.11 lib/qcourses/string_ex.rb
qcourses-0.1.10 lib/qcourses/string_ex.rb
qcourses-0.1.9 lib/qcourses/string_ex.rb
qcourses-0.1.8 lib/qcourses/string_ex.rb
qcourses-0.1.7 lib/qcourses/string_ex.rb
qcourses-0.1.6 lib/qcourses/string_ex.rb
qcourses-0.1.5 lib/qcourses/string_ex.rb
qcourses-0.1.4 lib/qcourses/string_ex.rb
qcourses-0.1.3 lib/qcourses/string_ex.rb
qcourses-0.1.2 lib/qcourses/string_ex.rb