Class: PuppetX::Puppetlabs::Migration::CatalogDeltaModel::Attribute
- Inherits:
-
Diff
- Object
- DeltaEntity
- Diff
- PuppetX::Puppetlabs::Migration::CatalogDeltaModel::Attribute
- Defined in:
- lib/puppet_x/puppetlabs/migration/catalog_delta_model.rb
Overview
A Resource Attribute. Attributes stems from parameters, and information encoded in the resource (i.e. ‘exported` or `tags`)
Constant Summary collapse
- SET_ATTRIBUTES =
%w(before after subscribe notify tags).freeze
Instance Attribute Summary collapse
- #name ⇒ Object readonly
- #value ⇒ Object readonly
Attributes inherited from Diff
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Attribute
constructor
A new instance of Attribute.
Methods inherited from Diff
Methods inherited from DeltaEntity
Methods included from ModelObject
#initialize_from_hash, #to_hash
Constructor Details
#initialize(name, value) ⇒ Attribute
Returns a new instance of Attribute.
125 126 127 128 129 130 131 132 |
# File 'lib/puppet_x/puppetlabs/migration/catalog_delta_model.rb', line 125 def initialize(name, value) @name = assert_type(String, name) if SET_ATTRIBUTES.include?(name) value = [value] unless value.is_a?(Array) value = Set.new(value) end @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
116 117 118 |
# File 'lib/puppet_x/puppetlabs/migration/catalog_delta_model.rb', line 116 def name @name end |
#value ⇒ Object (readonly)
121 122 123 |
# File 'lib/puppet_x/puppetlabs/migration/catalog_delta_model.rb', line 121 def value @value end |