Method: Mappable::Map#value_for
- Defined in:
- app/models/mappable/map.rb
#value_for(mapping_name, in_value) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/models/mappable/map.rb', line 23 def value_for(mapping_name, in_value) direction = :from if to.to_sym == mapping_name direction = :to if from.to_sym == mapping_name if direction mapping = cached_mappings[direction] key = in_value.downcase mapping.nil? ? nil : mapping[key] end end |