Class: Rack::RackSeo::Dispatcher
- Inherits:
-
Object
- Object
- Rack::RackSeo::Dispatcher
- Defined in:
- lib/rack-seo/dispatcher.rb
Instance Attribute Summary collapse
-
#description_selector ⇒ Object
Returns the value of attribute description_selector.
-
#keywords_selector ⇒ Object
Returns the value of attribute keywords_selector.
-
#title_format ⇒ Object
Returns the value of attribute title_format.
Instance Method Summary collapse
-
#initialize(config, current_path) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
Constructor Details
#initialize(config, current_path) ⇒ Dispatcher
Returns a new instance of Dispatcher.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rack-seo/dispatcher.rb', line 6 def initialize(config, current_path) if config["custom"] matching_path = config["custom"].detect do |custom_path| (custom_path["matcher"].is_a?(String) && current_path.include?(custom_path["matcher"])) or (custom_path["matcher"].is_a?(Regexp) && current_path =~ custom_path["matcher"]) end end matching_path ||= {} @title_format = matching_path["title_format"] || config["default"]["title_format"] @description_selector = matching_path["meta_description_selector"] || config["default"]["meta_description_selector"] @keywords_selector = matching_path["meta_keywords_selector"] || config["default"]["meta_keywords_selector"] end |
Instance Attribute Details
#description_selector ⇒ Object
Returns the value of attribute description_selector.
3 4 5 |
# File 'lib/rack-seo/dispatcher.rb', line 3 def description_selector @description_selector end |
#keywords_selector ⇒ Object
Returns the value of attribute keywords_selector.
4 5 6 |
# File 'lib/rack-seo/dispatcher.rb', line 4 def keywords_selector @keywords_selector end |
#title_format ⇒ Object
Returns the value of attribute title_format.
2 3 4 |
# File 'lib/rack-seo/dispatcher.rb', line 2 def title_format @title_format end |