Class: HumanAttributes::Formatters::Date
- Defined in:
- lib/human_attributes/formatters/date.rb
Constant Summary
Constants included from Config
Instance Attribute Summary
Attributes inherited from Base
#attribute, #default, #options, #suffix, #type
Instance Method Summary collapse
Methods inherited from Base
Methods included from Config
#category_by_type, #formatter_by_type, #known_type?, #raise_error, #suffix_by_type, #type_config
Constructor Details
This class inherits a constructor from HumanAttributes::Formatters::Base
Instance Method Details
#apply(_instance, value) ⇒ Object
4 5 6 7 8 |
# File 'lib/human_attributes/formatters/date.rb', line 4 def apply(_instance, value) I18n.l(value.to_date, ) rescue nil end |