Class: ContentfulMiddleman::Core

Inherits:
Middleman::Extension
  • Object
show all
Defined in:
lib/contentful_middleman/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Core.



59
60
61
62
63
64
65
66
67
# File 'lib/contentful_middleman/core.rb', line 59

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

  this = self # Hack due to context change
  app.before_server do
    this.webhook_options
  end
end

Instance Attribute Details

#middleman_appObject (readonly)

Returns the value of attribute middleman_app.



58
59
60
# File 'lib/contentful_middleman/core.rb', line 58

def middleman_app
  @middleman_app
end

Instance Method Details

#after_configurationObject

Middleman hooks



72
73
74
75
76
# File 'lib/contentful_middleman/core.rb', line 72

def after_configuration
  massage_options

  ContentfulMiddleman.instances << (ContentfulMiddleman::Instance.new self)
end

#webhook_optionsObject



78
79
80
# File 'lib/contentful_middleman/core.rb', line 78

def webhook_options
  ::ContentfulMiddleman::WebhookHandler.start(options) if options.rebuild_on_webhook
end