Class: AwsProvisioner::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_provisioner/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/aws_provisioner/resource.rb', line 6

def name
  @name
end

#propertiesObject (readonly)

Returns the value of attribute properties.



6
7
8
# File 'lib/aws_provisioner/resource.rb', line 6

def properties
  @properties
end

#typeObject (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_hObject



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