Class: Perfectline::LocaleRouting::Config
- Inherits:
-
Object
- Object
- Perfectline::LocaleRouting::Config
- Defined in:
- lib/locale_routing/config.rb
Class Method Summary collapse
-
.bootstrap ⇒ Object
straps the LocaleRouteSet module into ActionControllers RouteSet.
- .enabled=(enabled) ⇒ Object
- .enabled? ⇒ Boolean
- .host_mapping ⇒ Object
- .mapping {|Mapper.new(@host_mapping)| ... } ⇒ Object
- .match_from ⇒ Object
- .match_from=(location) ⇒ Object
Class Method Details
.bootstrap ⇒ Object
straps the LocaleRouteSet module into ActionControllers RouteSet
53 54 55 |
# File 'lib/locale_routing/config.rb', line 53 def bootstrap ActionController::Routing::RouteSet.send(:include, Perfectline::LocaleRouting::LocaleRouteSet) if self.enabled? end |
.enabled=(enabled) ⇒ Object
28 29 30 |
# File 'lib/locale_routing/config.rb', line 28 def enabled=(enabled) @enabled = (enabled.nil? || enabled == false) ? false : true end |
.enabled? ⇒ Boolean
24 25 26 |
# File 'lib/locale_routing/config.rb', line 24 def enabled? @enabled end |
.host_mapping ⇒ Object
44 45 46 |
# File 'lib/locale_routing/config.rb', line 44 def host_mapping @host_mapping end |
.mapping {|Mapper.new(@host_mapping)| ... } ⇒ Object
48 49 50 |
# File 'lib/locale_routing/config.rb', line 48 def mapping yield Mapper.new(@host_mapping) end |
.match_from ⇒ Object
32 33 34 |
# File 'lib/locale_routing/config.rb', line 32 def match_from @match_from end |
.match_from=(location) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/locale_routing/config.rb', line 36 def match_from=(location) unless @locale_match_options.include?(location.to_sym) raise "#{location.to_sym} is not supported as Perfectline::LocaleRouting.match_from option." end @match_from = location.to_sym end |