Class: Puppet::DataProviders::DataAdapter Private
- Inherits:
-
Pops::Adaptable::Adapter
- Object
- Pops::Adaptable::Adapter
- Puppet::DataProviders::DataAdapter
- Includes:
- Plugins::DataProviders
- Defined in:
- lib/puppet/data_providers/data_adapter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A DataAdapter adapts an object with a Hash of data
Direct Known Subclasses
Constant Summary
Constants included from Plugins::DataProviders
Plugins::DataProviders::ENV_DATA_PROVIDERS_KEY, Plugins::DataProviders::ENV_DATA_PROVIDERS_TYPE, Plugins::DataProviders::MODULE_DATA_PROVIDERS_KEY, Plugins::DataProviders::MODULE_DATA_PROVIDERS_TYPE, Plugins::DataProviders::PATH_BASED_DATA_PROVIDER_FACTORIES_KEY, Plugins::DataProviders::PATH_BASED_DATA_PROVIDER_FACTORIES_TYPE, Plugins::DataProviders::PER_MODULE_DATA_PROVIDER_KEY, Plugins::DataProviders::PER_MODULE_DATA_PROVIDER_TYPE
Constants inherited from Pops::Adaptable::Adapter
Pops::Adaptable::Adapter::DOUBLE_COLON, Pops::Adaptable::Adapter::USCORE
Instance Attribute Summary collapse
- #data ⇒ Object private
Class Method Summary collapse
- .create_adapter(o) ⇒ Object private
Instance Method Summary collapse
- #[](name) ⇒ Object private
- #[]=(name, value) ⇒ Object private
- #has_name?(name) ⇒ Boolean private
-
#initialize ⇒ DataAdapter
constructor
private
A new instance of DataAdapter.
Methods inherited from Pops::Adaptable::Adapter
adapt, adapt_new, associate_adapter, clear, get, instance_var_name, self_attr_name
Constructor Details
#initialize ⇒ DataAdapter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of DataAdapter.
13 14 15 |
# File 'lib/puppet/data_providers/data_adapter.rb', line 13 def initialize @data = {} end |
Instance Attribute Details
#data ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/puppet/data_providers/data_adapter.rb', line 7 def data @data end |
Class Method Details
.create_adapter(o) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/puppet/data_providers/data_adapter.rb', line 9 def self.create_adapter(o) new end |
Instance Method Details
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/puppet/data_providers/data_adapter.rb', line 17 def [](name) @data[name] end |
#[]=(name, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 29 30 |
# File 'lib/puppet/data_providers/data_adapter.rb', line 25 def []=(name, value) unless value.is_a?(Hash) raise ArgumentError, "Given value must be a Hash, got: #{value.class}." end @data[name] = value end |
#has_name?(name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/puppet/data_providers/data_adapter.rb', line 21 def has_name?(name) @data.has_key? name end |