Class: Middleman::Webcomic::MockApp
- Inherits:
-
Object
- Object
- Middleman::Webcomic::MockApp
- Defined in:
- lib/middleman-webcomic/mock_app.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
-
#initialize(settings = {}) ⇒ MockApp
constructor
A new instance of MockApp.
- #method_missing(key, value = nil) ⇒ Object
- #parse_front_matter(content) ⇒ Object
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
#settings ⇒ Object (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 |