Class: JekyllMetrics::Config
- Inherits:
-
Object
- Object
- JekyllMetrics::Config
- Defined in:
- lib/jekyll-metrics/config.rb
Overview
Hold the configuration needed for Hook to work
Constant Summary collapse
- CONFIG_NAME =
'jekyll_metrics'- DEFAULT_TEMPLATE_PATH =
'lib/jekyll-metrics/includes/metrics.html.liquid'- DEFAULT_CONFIG =
{ 'template' => DEFAULT_TEMPLATE_PATH, 'yandex_metrica_id' => 'XXXXXXXX', 'google_analytics_id' => 'XX-XXXXXXXXX-X', }.freeze
Instance Attribute Summary collapse
-
#site ⇒ Object
Returns the value of attribute site.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(site) ⇒ Config
constructor
A new instance of Config.
- #plugin_vars ⇒ Object
- #template_path ⇒ Object
Constructor Details
#initialize(site) ⇒ Config
22 23 24 |
# File 'lib/jekyll-metrics/config.rb', line 22 def initialize(site) @site = site end |
Instance Attribute Details
#site ⇒ Object
Returns the value of attribute site.
20 21 22 |
# File 'lib/jekyll-metrics/config.rb', line 20 def site @site end |
Class Method Details
.instance(site) ⇒ Object
15 16 17 |
# File 'lib/jekyll-metrics/config.rb', line 15 def instance(site) @instance ||= Config.new(site) end |
Instance Method Details
#plugin_vars ⇒ Object
30 31 32 |
# File 'lib/jekyll-metrics/config.rb', line 30 def plugin_vars @plugin_vars ||= DEFAULT_CONFIG.merge(plugin_config) end |
#template_path ⇒ Object
26 27 28 |
# File 'lib/jekyll-metrics/config.rb', line 26 def template_path @template_path ||= build_template_path end |