Class: Vagrant::Puppetfile::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/puppetfile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



82
83
84
85
# File 'lib/vagrant/puppetfile.rb', line 82

def initialize
  @path = UNSET_VALUE
  @evaluator = UNSET_VALUE
end

Instance Attribute Details

#evaluatorObject

Returns the value of attribute evaluator.



80
81
82
# File 'lib/vagrant/puppetfile.rb', line 80

def evaluator
  @evaluator
end

#pathObject

Returns the value of attribute path.



79
80
81
# File 'lib/vagrant/puppetfile.rb', line 79

def path
  @path
end

Instance Method Details

#finalize!Object



94
95
96
97
# File 'lib/vagrant/puppetfile.rb', line 94

def finalize!
  @path = DEFAULT_PUPPETFILE_PATH if @path == UNSET_VALUE
  @evaluator = DEFAULT_PUPPETFILE_EVALUATOR if @evaluator == UNSET_VALUE
end

#validate(*_) ⇒ Object



87
88
89
90
91
92
# File 'lib/vagrant/puppetfile.rb', line 87

def validate(*_)
  errors = _detected_errors
  errors << 'path must be a String' unless @path.is_a? String
  errors << 'evaluator must be a String' unless @evaluator.is_a? String
  Hash[Vagrant::Puppetfile::Plugin.name => errors]
end