Class: VagrantPlugins::Triggers::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Triggers::Config
- Defined in:
- lib/vagrant-triggers/config.rb
Instance Attribute Summary collapse
-
#deprecation_warning ⇒ Object
readonly
Returns the value of attribute deprecation_warning.
-
#triggers ⇒ Object
readonly
Returns the value of attribute triggers.
Instance Method Summary collapse
- #after(actions, options = {}, &block) ⇒ Object
- #before(actions, options = {}, &block) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
7 8 9 10 |
# File 'lib/vagrant-triggers/config.rb', line 7 def initialize @deprecation_warning = false @triggers = [] end |
Instance Attribute Details
#deprecation_warning ⇒ Object (readonly)
Returns the value of attribute deprecation_warning.
4 5 6 |
# File 'lib/vagrant-triggers/config.rb', line 4 def deprecation_warning @deprecation_warning end |
#triggers ⇒ Object (readonly)
Returns the value of attribute triggers.
5 6 7 |
# File 'lib/vagrant-triggers/config.rb', line 5 def triggers @triggers end |
Instance Method Details
#after(actions, options = {}, &block) ⇒ Object
12 13 14 |
# File 'lib/vagrant-triggers/config.rb', line 12 def after(actions, = {}, &block) add_trigger(actions, :after, , block) end |
#before(actions, options = {}, &block) ⇒ Object
16 17 18 |
# File 'lib/vagrant-triggers/config.rb', line 16 def before(actions, = {}, &block) add_trigger(actions, :before, , block) end |
#validate(machine) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-triggers/config.rb', line 20 def validate(machine) errors = [] if @__invalid_methods && !@__invalid_methods.empty? errors << I18n.t("vagrant.config.common.bad_field", :fields => @__invalid_methods.to_a.sort.join(", ")) end { "triggers" => errors } end |