Class: String
Overview
Humanize
Instance Method Summary collapse
Instance Method Details
#humanize ⇒ Object
14 15 16 17 18 |
# File 'lib/helpers/ruby_ext.rb', line 14 def humanize sub(/\A_+/, '') .tr('_', ' ') .sub(/\A\w/) { |match| match.upcase } end |