Module: UsefulUtilities::I18n
Overview
I18n utilities
Instance Method Summary collapse
-
#humanize_type(object) ⇒ String
Humanized name.
Instance Method Details
#humanize_type(object) ⇒ String
Returns humanized name.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/useful_utilities/i18n.rb', line 8 def humanize_type(object) klass = case object when Class then object when object.respond_to?(:klass) then object.klass else object.class end klass.respond_to?(:model_name) ? klass.model_name.human : klass.to_s.underscore.humanize end |