Sha256: 806f32fdf01e422d02e7e8c41a398f90e1d1e4e6534dd8a4a4e83c4609fb4bcd
Contents?: true
Size: 334 Bytes
Versions: 2
Compression:
Stored size: 334 Bytes
Contents
# add the underscore from rails for snake_casing strings 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 def snake_case self.gsub(" ", "_").downcase end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
openstudio-analysis-0.1.10 | lib/openstudio/helpers/string.rb |
openstudio-analysis-0.1.9 | lib/openstudio/helpers/string.rb |