Class: Middleman::Webcomic::MockApp

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-webcomic/mock_app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ MockApp

Returns a new instance of MockApp.



11
12
13
# File 'lib/middleman-webcomic/mock_app.rb', line 11

def initialize(settings={})
  @settings= ::Thor::CoreExt::HashWithIndifferentAccess.new(settings)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(key, value = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/middleman-webcomic/mock_app.rb', line 15

def method_missing(key, value=nil)
  if @settings.has_key? key
    @settings[key]
  elsif @settings.has_key? key.to_s
    @settings[key.to_s]
  else
    #super Should it throw an error?
    nil
  end
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



9
10
11
# File 'lib/middleman-webcomic/mock_app.rb', line 9

def settings
  @settings
end

Instance Method Details

#parse_front_matter(content) ⇒ Object



26
27
28
# File 'lib/middleman-webcomic/mock_app.rb', line 26

def parse_front_matter(content)
  Middleman::CoreExtensions::FrontMatter.parse_front_matter(content)
end