Sha256: b9fdc2c0f2c8fcc7396012f29fcd3c19426e18ecc81e00cd3cb81a3e06b85dc3
Contents?: true
Size: 446 Bytes
Versions: 9
Compression:
Stored size: 446 Bytes
Contents
class String # pluralizes a string and turns it into a symbol # Example: # "apple".pluralize_to_sym # => :apples def pluralize_to_sym self.pluralize.to_sym end # takes human readable words and # turns it into ruby variable format # dash and spaces to underscore # and lowercases def variablize self.squeeze!(' ') self.gsub!(/\s+/,'_') self.gsub!('-', '_') self.squeeze!('_') self.downcase! self end end
Version data entries
9 entries across 9 versions & 1 rubygems