Class: Perfectline::LocaleRouting::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/locale_routing/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Mapper

Returns a new instance of Mapper.



5
6
7
# File 'lib/locale_routing/config.rb', line 5

def initialize(config)
  @config = config
end

Instance Method Details

#match(host, locale) ⇒ Object



9
10
11
# File 'lib/locale_routing/config.rb', line 9

def match(host, locale)
  @config.push({:host => host.to_s.gsub('.', '\.').gsub('*', '.*'), :locale => locale.to_s})
end