Class: Nugrant::Vagrant::V1::Config::User

Inherits:
Vagrant::Config::Base
  • Object
show all
Defined in:
lib/nugrant/vagrant/v1/config/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUser

Returns a new instance of User.



11
12
13
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 11

def initialize()
  @parameters = Nugrant::Parameters.new()
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



21
22
23
24
25
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 21

def method_missing(method, *args, &block)
  return @parameters.method_missing(method, *args, &block)
rescue KeyError
  raise Errors::ParameterNotFoundError, :key => method
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



9
10
11
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 9

def parameters
  @parameters
end

Instance Method Details

#[](param_name) ⇒ Object



15
16
17
18
19
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 15

def [](param_name)
  return @parameters[param_name]
rescue KeyError
  raise Errors::ParameterNotFoundError, :key => param_name
end

#defaults(parameters) ⇒ Object



31
32
33
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 31

def defaults(parameters)
  @parameters.defaults(parameters)
end

#defaults=(parameters) ⇒ Object



35
36
37
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 35

def defaults=(parameters)
  @parameters.defaults=(parameters)
end

#each(&block) ⇒ Object



27
28
29
# File 'lib/nugrant/vagrant/v1/config/user.rb', line 27

def each(&block)
  @parameters.each(&block)
end