Method: String#humanize

Defined in:
lib/sequel_model/inflector.rb

#humanizeObject

Capitalizes the first word and turns underscores into spaces and strips _id. Like titleize, this is meant for creating pretty output.

Examples

"employee_salary" #=> "Employee salary"
"author_id" #=> "Author"


214
215
216
# File 'lib/sequel_model/inflector.rb', line 214

def humanize
  gsub(/_id$/, "").gsub(/_/, " ").capitalize
end