class DataMaps::Converter::Prefix
Adds a prefix to the given data
@since 0.0.1
Public Instance Methods
execute(data)
click to toggle source
The execute method to adds a prefix to the given data
@param [mixed] data
# File lib/data_maps/converter/affixes.rb, line 10 def execute(data) case data when Array then data.map{ |v| "#{option}#{v}" } when Hash then Hash[data.map{ |k,v| [k,"#{option}#{v}"] }] else "#{option}#{data}" end end