Sha256: a5ef020926cffade548cfafcccb5a59922158619af16c285c221aef643c62993

Contents?: true

Size: 177 Bytes

Versions: 54

Compression:

Stored size: 177 Bytes

Contents

class String
  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

54 entries across 51 versions & 11 rubygems

Version Path
velocity_client_ruby-0.3.0 lib/initializers/string.rb
velocity_client_ruby-0.2.1 lib/initializers/string.rb
hecks-domain-1.0.0 lib/hecks/domain/templates/lib/support/support/string.rb
hecks-domain-1.0.0 lib/hecks/domain/support/string.rb
hecks-domain-0.3.0 lib/hecks/domain/support/string.rb
hecks-domain-0.3.0 lib/hecks/domain/templates/lib/support/support/string.rb
hecks-domain-0.1.0 lib/hecks/domain/templates/lib/support/support/string.rb
hecks-domain-0.1.0 lib/hecks/domain/support/string.rb
stormglass-0.2.0 lib/stormglass/string.rb
stormglass-0.1.1 lib/stormglass/string.rb
get_to_work-0.1.5 lib/ext/string.rb
get_to_work-0.1.4 lib/ext/string.rb
playlyfe_client-1.1.6 lib/string_addons.rb
playlyfe_client-1.1.5 lib/string_addons.rb
playlyfe_client-1.1.3 lib/string_addons.rb
playlyfe_client-1.1.2 lib/string_addons.rb
playlyfe_client-1.1.1 lib/string_addons.rb
playlyfe_client-1.1.0 lib/string_addons.rb
playlyfe_client-1.0.6 lib/string_addons.rb
playlyfe_client-1.0.5 lib/string_addons.rb