Method: I18n::Locale::Fallbacks#map

Defined in:
lib/i18n/locale/fallbacks.rb

#map(*args, &block) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/i18n/locale/fallbacks.rb', line 67

def map(*args, &block)
  if args.count == 1 && !block_given?
    mappings = args.first
    mappings.each do |from, to|
      from, to = from.to_sym, Array(to)
      to.each do |_to|
        @map[from] ||= []
        @map[from] << _to.to_sym
      end
    end
  else
    @map.map(*args, &block)
  end
end