Sha256: 7ecc62ed145866e29897332bf26b1e6ec5c03c029776ada75dbb58ee0478de16
Contents?: true
Size: 351 Bytes
Versions: 9
Compression:
Stored size: 351 Bytes
Contents
module MessagesDictionary class SpecialString attr_accessor :string def initialize(string) @string = string end def snake_case string.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end end end
Version data entries
9 entries across 9 versions & 1 rubygems