Class: FluentECS::Task

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/fluent_ecs/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Resource

included

Constructor Details

#initialize(attrs = {}) ⇒ Task

Returns a new instance of Task.



9
10
11
12
13
14
15
16
# File 'lib/fluent_ecs/task.rb', line 9

def initialize(attrs = {})
  @arn            = attrs['Arn']
  @desired_status = attrs['DesiredStatus']
  @family         = attrs['Family']
  @known_status   = attrs['KnownStatus']
  @version        = attrs['Version']
  @container_data = attrs['Containers']
end

Instance Attribute Details

#arnObject

Returns the value of attribute arn.



6
7
8
# File 'lib/fluent_ecs/task.rb', line 6

def arn
  @arn
end

#container_instanceObject

Returns the value of attribute container_instance.



6
7
8
# File 'lib/fluent_ecs/task.rb', line 6

def container_instance
  @container_instance
end

#desired_statusObject

Returns the value of attribute desired_status.



6
7
8
# File 'lib/fluent_ecs/task.rb', line 6

def desired_status
  @desired_status
end

#familyObject

Returns the value of attribute family.



6
7
8
# File 'lib/fluent_ecs/task.rb', line 6

def family
  @family
end

#known_statusObject

Returns the value of attribute known_status.



6
7
8
# File 'lib/fluent_ecs/task.rb', line 6

def known_status
  @known_status
end

#versionObject

Returns the value of attribute version.



6
7
8
# File 'lib/fluent_ecs/task.rb', line 6

def version
  @version
end

Instance Method Details

#containersObject



18
19
20
21
22
# File 'lib/fluent_ecs/task.rb', line 18

def containers
  @containers ||= @container_data.map do |d|
    Container.new(d).tap { |c| c.task = self }
  end
end