Class: Format::Formatter
- Inherits:
-
Object
- Object
- Format::Formatter
- Defined in:
- lib/src/format/formatter.rb
Instance Method Summary collapse
- #format_value(value, props) ⇒ Object
-
#initialize(yml, modifiers) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
Instance Method Details
#format_value(value, props) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/src/format/formatter.rb', line 13 def format_value(value, props) modifier_prop, mapper_prop = props.values_at(:modifier, :mapper) value .then { |it| modifier.apply(it, modifier_prop) } .then { |it| nullify_empty_value(it) } .then { |it| mapper.apply(it, mapper_prop) } end |