Sha256: 37ee2573ac18bb68d1fc0123420ffbd457c2108904374c4bd03ca1c1182f3d0b
Contents?: true
Size: 366 Bytes
Versions: 159
Compression:
Stored size: 366 Bytes
Contents
module Generator module Underscore refine String do def underscore downcase.gsub(/[- ]/, '_').gsub(/[^\w?]/, '') end def camel_case underscore.split('_').map(&:capitalize).join end end refine Integer do def underscore self.to_s.reverse.gsub(/...(?=.)/, '\&_').reverse end end end end
Version data entries
159 entries across 159 versions & 1 rubygems