Class: FluentECS::Metadata
- Inherits:
-
Object
- Object
- FluentECS::Metadata
- Includes:
- Resource
- Defined in:
- lib/fluent_ecs/metadata.rb
Instance Attribute Summary collapse
-
#arn ⇒ Object
Returns the value of attribute arn.
-
#cluster ⇒ Object
Returns the value of attribute cluster.
- #containers ⇒ Object
- #tasks ⇒ Object
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Metadata
constructor
A new instance of Metadata.
Methods included from Resource
Constructor Details
#initialize(attrs = {}) ⇒ Metadata
Returns a new instance of Metadata.
10 11 12 13 14 15 |
# File 'lib/fluent_ecs/metadata.rb', line 10 def initialize(attrs = {}) @arn = attrs['ContainerInstanceArn'] @cluster = attrs['Cluster'] @version = attrs['Version'] @task_data = attrs['Tasks'] || Array(Task.get['Tasks']) end |
Instance Attribute Details
#arn ⇒ Object
Returns the value of attribute arn.
7 8 9 |
# File 'lib/fluent_ecs/metadata.rb', line 7 def arn @arn end |
#cluster ⇒ Object
Returns the value of attribute cluster.
7 8 9 |
# File 'lib/fluent_ecs/metadata.rb', line 7 def cluster @cluster end |
#containers ⇒ Object
23 24 25 |
# File 'lib/fluent_ecs/metadata.rb', line 23 def containers @containers ||= tasks.map(&:containers).flatten end |
#tasks ⇒ Object
17 18 19 20 21 |
# File 'lib/fluent_ecs/metadata.rb', line 17 def tasks @tasks ||= @task_data.map do |d| Task.new(d).tap { |t| t.container_instance = self } end end |
#version ⇒ Object
Returns the value of attribute version.
7 8 9 |
# File 'lib/fluent_ecs/metadata.rb', line 7 def version @version end |