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.
-
#guest_capabilities ⇒ Hash<Symbol, Registry>
readonly
This contains all the registered guest capabilities.
-
#guests ⇒ Registry<Symbol, Array<Class, Symbol>>
readonly
This contains all the guests and their parents.
-
#providers ⇒ Hash<Symbol, Registry>
readonly
This contains all the provider plugins by name, and returns the provider class and options.
Instance Method Summary collapse
-
#initialize ⇒ Components
constructor
A new instance of Components.
Constructor Details
#initialize ⇒ Components
Returns a new instance of Components.
35 36 37 38 39 40 41 42 43 |
# File 'lib/vagrant/plugin/v2/components.rb', line 35 def initialize # The action hooks hash defaults to [] @action_hooks = Hash.new { |h, k| h[k] = [] } @configs = Hash.new { |h, k| h[k] = Registry.new } @guests = Registry.new @guest_capabilities = Hash.new { |h, k| h[k] = Registry.new } @providers = 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 |
#guest_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered guest capabilities.
27 28 29 |
# File 'lib/vagrant/plugin/v2/components.rb', line 27 def guest_capabilities @guest_capabilities end |
#guests ⇒ Registry<Symbol, Array<Class, Symbol>> (readonly)
This contains all the guests and their parents.
22 23 24 |
# File 'lib/vagrant/plugin/v2/components.rb', line 22 def guests @guests end |
#providers ⇒ Hash<Symbol, Registry> (readonly)
This contains all the provider plugins by name, and returns the provider class and options.
33 34 35 |
# File 'lib/vagrant/plugin/v2/components.rb', line 33 def providers @providers end |