Class: HumanAttributes::Formatters::Boolean
- Defined in:
- lib/human_attributes/formatters/boolean.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 |
# File 'lib/human_attributes/formatters/boolean.rb', line 4 def apply(_instance, value) key = !!value ? "positive" : "negative" I18n.t("boolean.#{key}") end |