Class: ContentfulMiddleman::Core
- Inherits:
-
Middleman::Extension
- Object
- Middleman::Extension
- ContentfulMiddleman::Core
- Includes:
- Helpers
- Defined in:
- lib/contentful_middleman/core.rb
Instance Attribute Summary collapse
-
#middleman_app ⇒ Object
readonly
Returns the value of attribute middleman_app.
Instance Method Summary collapse
-
#after_configuration ⇒ Object
Middleman hooks.
-
#initialize(app, options_hash = {}, &block) ⇒ Core
constructor
A new instance of Core.
- #webhook_options ⇒ Object
Methods included from Helpers
#contentful_instances, #localize, #localize_array, #localize_entry, #localize_value, #rich_text, #with_preview
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ Core
Returns a new instance of Core.
71 72 73 74 75 76 77 78 79 |
# File 'lib/contentful_middleman/core.rb', line 71 def initialize(app, = {}, &block) super @middleman_app = app this = self # Hack due to context change app.before_server do this. end end |
Instance Attribute Details
#middleman_app ⇒ Object (readonly)
Returns the value of attribute middleman_app.
70 71 72 |
# File 'lib/contentful_middleman/core.rb', line 70 def middleman_app @middleman_app end |
Instance Method Details
#after_configuration ⇒ Object
Middleman hooks
84 85 86 87 88 |
# File 'lib/contentful_middleman/core.rb', line 84 def after_configuration ContentfulMiddleman.instances << (ContentfulMiddleman::Instance.new self) end |
#webhook_options ⇒ Object
90 91 92 |
# File 'lib/contentful_middleman/core.rb', line 90 def ::ContentfulMiddleman::WebhookHandler.start() if .rebuild_on_webhook end |