Module: RubyAemAws::AbstractSingleComponent
- Includes:
- AbstractComponent
- Defined in:
- lib/ruby_aem_aws/abstract/single_component.rb
Overview
Add common methods to all Components.
Instance Method Summary collapse
Methods included from AbstractComponent
Methods included from InstanceDescriber
#describe_instance, #describe_instances
Instance Method Details
#get_all_instances ⇒ Object
31 32 33 |
# File 'lib/ruby_aem_aws/abstract/single_component.rb', line 31 def get_all_instances [get_instance] end |
#get_instance ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/ruby_aem_aws/abstract/single_component.rb', line 22 def get_instance instances = ec2_resource.instances(filter_for_descriptor).select { |instance| InstanceState::ALL_ACTIVE.include?(instance.state.name) } count = instances.count raise RubyAemAws::ExpectedSingleInstanceError if count > 1 return nil if count.zero? instances.first end |