Method: Vagrant::Config::Top#method_missing

Defined in:
lib/vagrant/config/top.rb

#method_missing(name, *args) ⇒ Object

We use method_missing as a way to get the configuration that is used for Vagrant and load the proper configuration classes for each.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/vagrant/config/top.rb', line 19

def method_missing(name, *args)
  return @keys[name] if @keys.has_key?(name)

  config_klass = @registry.get(name.to_sym)
  if config_klass
    # Instantiate the class and return the instance
    @keys[name] = config_klass.new
    return @keys[name]
  else
    # Super it up to probably raise a NoMethodError
    super
  end
end