Class: StyleGuideAPI::MiddlemanExtension

Inherits:
Middleman::Extension
  • Object
show all
Defined in:
lib/styleguide-api/middleman.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MiddlemanExtension.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/styleguide-api/middleman.rb', line 6

def initialize(app, options_hash = {}, &block)
  super

  app.configure :development do
    StyleGuideAPI.live = true
  end

  if options_hash.has_key?(:templates)
    StyleGuideAPI.add_templates options_hash[:templates]
  end

  if options_hash.has_key?(:load)
    StyleGuideAPI.load options_hash[:load]
  end

  if options_hash.has_key?(:theme)
    StyleGuideAPI.theme = options_hash[:theme]
  end
end