Module: MyExtension
- Defined in:
- lib/middleman-core/templates/extension/lib/lib.rb
Overview
Extension namespace
Class Method Summary collapse
-
.registered(app, options = {}) ⇒ Object
(also: included)
Called when user ‘activate`s your extension.
Class Method Details
.registered(app, options = {}) ⇒ Object Also known as: included
Called when user ‘activate`s your extension
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/middleman-core/templates/extension/lib/lib.rb', line 9 def registered(app, ={}) # Setup extension-specific config app.set :config_variable, false # Include class methods # app.extend ClassMethods # Include instance methods # app.send :include, InstanceMethods app.after_configuration do # Do something # config_variable is now either the default or the user's # setting from config.rb end end |