Module: RubyAemAws::AbstractGroupedComponent
Overview
Add common methods to all Components.
Instance Method Summary
collapse
#to_s
#describe_instance, #describe_instances
Instance Method Details
#get_all_instances ⇒ Object
22
23
24
|
# File 'lib/ruby_aem_aws/abstract/grouped_component.rb', line 22
def get_all_instances
ec2_resource.instances(filter_for_descriptor)
end
|
#get_instance_by_id(instance_id) ⇒ Object
26
27
28
|
# File 'lib/ruby_aem_aws/abstract/grouped_component.rb', line 26
def get_instance_by_id(instance_id)
ec2_resource.instance(instance_id)
end
|
#get_num_of_instances ⇒ Object
30
31
32
|
# File 'lib/ruby_aem_aws/abstract/grouped_component.rb', line 30
def get_num_of_instances
get_all_instances.entries.length
end
|
#get_random_instance ⇒ Object
34
35
36
|
# File 'lib/ruby_aem_aws/abstract/grouped_component.rb', line 34
def get_random_instance
get_all_instances.entries.sample
end
|