Class: Middleman::DisqusExtension

Inherits:
Extension
  • Object
show all
Defined in:
lib/middleman-disqus/extension.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options_hash = {}, &block) ⇒ DisqusExtension

Returns a new instance of DisqusExtension.



7
8
9
10
11
# File 'lib/middleman-disqus/extension.rb', line 7

def initialize(app, options_hash={}, &block)
  super
  # place in class variable so helpers can access
  @@options = options
end

Class Method Details

.options(options = {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/middleman-disqus/extension.rb', line 13

def self.options(options = {})
  options = options.to_hash.map do |k,obj|
    k =~ /^disqus_(.*)$/ ? [$1, obj] : nil
  end
  options = Hash[options.compact]
  @@options.to_h.merge(options).with_indifferent_access
end