Class: VagrantPlugins::HostRubyProvisioner::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::HostRubyProvisioner::Config
- Defined in:
- lib/vagrant-host-ruby-provisioner/config.rb
Instance Attribute Summary collapse
-
#clean ⇒ Object
Returns the value of attribute clean.
-
#cwd ⇒ Object
Returns the value of attribute cwd.
-
#routine ⇒ Object
Returns the value of attribute routine.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 |
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 10 def initialize @clean = UNSET_VALUE @cwd = UNSET_VALUE @routine = UNSET_VALUE end |
Instance Attribute Details
#clean ⇒ Object
Returns the value of attribute clean.
6 7 8 |
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 6 def clean @clean end |
#cwd ⇒ Object
Returns the value of attribute cwd.
7 8 9 |
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 7 def cwd @cwd end |
#routine ⇒ Object
Returns the value of attribute routine.
8 9 10 |
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 8 def routine @routine end |
Instance Method Details
#finalize! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 16 def finalize! if @clean == UNSET_VALUE @clean = lambda {} end if @cwd == UNSET_VALUE @cwd = nil end if @routine == UNSET_VALUE @routine = lambda {} end end |
#validate(machine) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 30 def validate machine errors = _detected_errors results = {} if ! @clean.lambda? errors << (I18n.t :'vagrant_host_ruby_provisioner.config.clean.not_lambda') end if ! @routine.lambda? errors << (I18n.t :'vagrant_host_ruby_provisioner.config.routine.not_lambda') end results[HostRubyProvisioner::INFO[:name]] = errors results end |