module FlatMap::Mapping::Reader::Formatted::Formats
Hosts various formats that can be applied to values read by mappings for post-processing.
Public Instance Methods
enum(value, property = :name)
click to toggle source
Return the specified property
of a value
which is supposed to be an enum
record. By default, uses :name
. However, :description
might be also useful for UI purposes.
@param [Object] value @param [Symbol] property @return [Object]
# File lib/flat_map/mapping/reader/formatted/formats.rb, line 22 def enum(value, property = :name) value.send(property) if value end
i18n_l(value)
click to toggle source
Pass value
to I18n::l
method.
# File lib/flat_map/mapping/reader/formatted/formats.rb, line 8 def i18n_l(value) I18n::l(value) if value end