Class: AwsProvisioner::Resource
- Defined in:
- lib/aws_provisioner/resource.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, name, hash = {}) ⇒ Resource
constructor
A new instance of Resource.
- #to_h ⇒ Object
Constructor Details
#initialize(type, name, hash = {}) ⇒ Resource
Returns a new instance of Resource.
8 9 10 11 12 |
# File 'lib/aws_provisioner/resource.rb', line 8 def initialize(type, name, hash={}) @name = name or raise ArgumentError @properties = Properties.new(hash) @type = type end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/aws_provisioner/resource.rb', line 6 def name @name end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
6 7 8 |
# File 'lib/aws_provisioner/resource.rb', line 6 def properties @properties end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/aws_provisioner/resource.rb', line 6 def type @type end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 |
# File 'lib/aws_provisioner/resource.rb', line 14 def to_h h = properties.to_t h["Type"] = type h end |