Class: Vagrant::Plugin::V2::Components
- Inherits:
-
Object
- Object
- Vagrant::Plugin::V2::Components
- Defined in:
- lib/vagrant/plugin/v2/components.rb
Overview
This is the container class for the components of a single plugin. This allows us to separate the plugin class which defines the components, and the actual container of those components. This removes a bit of state overhead from the plugin class itself.
Instance Attribute Summary collapse
-
#action_hooks ⇒ Hash<Symbol, Array>
readonly
This contains all the action hooks.
-
#configs ⇒ Hash<Symbol, Registry>
readonly
This contains all the configuration plugins by scope.
Instance Method Summary collapse
-
#initialize ⇒ Components
constructor
A new instance of Components.
Constructor Details
#initialize ⇒ Components
Returns a new instance of Components.
19 20 21 22 23 24 25 |
# File 'lib/vagrant/plugin/v2/components.rb', line 19 def initialize # The action hooks hash defaults to [] @action_hooks = Hash.new { |h, k| h[k] = [] } # Create the configs hash which defaults to a registry @configs = Hash.new { |h, k| h[k] = Registry.new } end |
Instance Attribute Details
#action_hooks ⇒ Hash<Symbol, Array> (readonly)
This contains all the action hooks.
12 13 14 |
# File 'lib/vagrant/plugin/v2/components.rb', line 12 def action_hooks @action_hooks end |
#configs ⇒ Hash<Symbol, Registry> (readonly)
This contains all the configuration plugins by scope.
17 18 19 |
# File 'lib/vagrant/plugin/v2/components.rb', line 17 def configs @configs end |