Module: Mixlib::Config

Included in:
Anvil::Config
Defined in:
lib/gem_ext/mixlib.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Override Mixlib::Config#method_missing so we can do things like this:

Examples:

define a nested group without use config_context


projects do
  branch_flow %w[release master]
  project-one do
    branch_flow %w[integration release master]
  end
end


15
16
17
18
19
20
21
# File 'lib/gem_ext/mixlib.rb', line 15

def method_missing(method, *args, &block)
  if block_given?
    config_context(method, &block)
  else
    old_method_missing(method, *args)
  end
end

Instance Method Details

#old_method_missingObject



2
# File 'lib/gem_ext/mixlib.rb', line 2

alias_method :old_method_missing, :method_missing