Module: RubyAemAws::InstanceDescriber
- Included in:
- AbstractComponent
- Defined in:
- lib/ruby_aem_aws/mixins/instance_describer.rb
Overview
Mixin for describing component EC2 instance state. Add this to a component to make it capable of describing its instances.
Instance Method Summary collapse
- #describe_instance(instance) ⇒ Object
-
#describe_instances ⇒ Object
A string containing instance descriptions.
Instance Method Details
#describe_instance(instance) ⇒ Object
30 31 32 |
# File 'lib/ruby_aem_aws/mixins/instance_describer.rb', line 30 def describe_instance(instance) "#{instance.instance_id} (#{instance.state.name} #{instance.state.code})" end |
#describe_instances ⇒ Object
Returns a string containing instance descriptions.
20 21 22 23 24 25 26 27 28 |
# File 'lib/ruby_aem_aws/mixins/instance_describer.rb', line 20 def describe_instances descriptions = [] get_all_instances.each do |i| next if i.nil? descriptions.push(describe_instance(i)) end descriptions.join(', ') end |