Class: DrawCloud::WaitHandle::WaitCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/draw_cloud/wait_handle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handle, timeout, count, depends_on) ⇒ WaitCondition

Returns a new instance of WaitCondition.



23
24
25
26
27
28
# File 'lib/draw_cloud/wait_handle.rb', line 23

def initialize(handle, timeout, count, depends_on)
  @handle = handle
  @timeout = timeout
  @count = count
  @depends_on = depends_on
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



22
23
24
# File 'lib/draw_cloud/wait_handle.rb', line 22

def count
  @count
end

#depends_onObject

Returns the value of attribute depends_on.



22
23
24
# File 'lib/draw_cloud/wait_handle.rb', line 22

def depends_on
  @depends_on
end

#handleObject

Returns the value of attribute handle.



22
23
24
# File 'lib/draw_cloud/wait_handle.rb', line 22

def handle
  @handle
end

#timeoutObject

Returns the value of attribute timeout.



22
23
24
# File 'lib/draw_cloud/wait_handle.rb', line 22

def timeout
  @timeout
end

Instance Method Details

#resource_nameObject



30
31
32
# File 'lib/draw_cloud/wait_handle.rb', line 30

def resource_name
  DrawCloud.resource_name(handle) + "Condition"
end

#to_hObject



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/draw_cloud/wait_handle.rb', line 34

def to_h
  h = {
    "Type" => "AWS::CloudFormation::WaitCondition",
    "Properties" => {
      "Handle" => DrawCloud.ref(handle),
      "Timeout" => timeout
    }
  }
  h["DependsOn"] = DrawCloud.resource_name(depends_on) if depends_on
  h["Properties"]["Count"] = count unless count.nil?
  h
end