Class: Perfectline::LocaleRouting::Mapper
- Inherits:
-
Object
- Object
- Perfectline::LocaleRouting::Mapper
- Defined in:
- lib/locale_routing/config.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Mapper
constructor
A new instance of Mapper.
- #match(host, locale) ⇒ Object
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 |