Module: Middleman::Configuration::Global::ClassMethods
- Defined in:
- lib/middleman-core/configuration.rb
Instance Method Summary collapse
-
#config ⇒ ConfigurationManager
Global configuration for the whole Middleman project.
-
#method_missing(method, *args) ⇒ Object
deprecated
Deprecated.
Prefer accessing settings through “config”.
-
#respond_to?(method, include_private = false) ⇒ Boolean
Needed so that method_missing makes sense.
-
#set(key, default = nil, &block) ⇒ void
deprecated
Deprecated.
Prefer accessing settings through “config”.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
Deprecated.
Prefer accessing settings through “config”.
Access global settings as methods, to preserve compatibility with old Middleman.
33 34 35 36 37 38 39 |
# File 'lib/middleman-core/configuration.rb', line 33 def method_missing(method, *args) if config.defines_setting? method config[method] else super end end |
Instance Method Details
#config ⇒ ConfigurationManager
Global configuration for the whole Middleman project.
13 14 15 |
# File 'lib/middleman-core/configuration.rb', line 13 def config @_config ||= ConfigurationManager.new end |
#respond_to?(method, include_private = false) ⇒ Boolean
Needed so that method_missing makes sense
42 43 44 |
# File 'lib/middleman-core/configuration.rb', line 42 def respond_to?(method, include_private = false) super || config.defines_setting?(method) end |
#set(key, default = nil, &block) ⇒ void
Deprecated.
Prefer accessing settings through “config”.
This method returns an undefined value.
Set attributes (global variables)
24 25 26 27 |
# File 'lib/middleman-core/configuration.rb', line 24 def set(key, default=nil, &block) config.define_setting(key, default) unless config.defines_setting?(key) @inst.set(key, default, &block) if @inst end |