Class: AwsRo::EC2::Instance
- Inherits:
-
Object
- Object
- AwsRo::EC2::Instance
- Extended by:
- Forwardable
- Includes:
- KeyValueAccessible
- Defined in:
- lib/aws_ro/ec2/instance.rb
Instance Attribute Summary collapse
-
#ec2_instance ⇒ Object
(also: #ec2)
readonly
Returns the value of attribute ec2_instance.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(ec2_instance) ⇒ Instance
constructor
A new instance of Instance.
- #running? ⇒ Boolean
Methods included from KeyValueAccessible
Constructor Details
#initialize(ec2_instance) ⇒ Instance
Returns a new instance of Instance.
17 18 19 20 21 22 23 24 |
# File 'lib/aws_ro/ec2/instance.rb', line 17 def initialize(ec2_instance) @ec2_instance = ec2_instance if @ec2_instance.respond_to?(:tags) = (@ec2_instance.) define_custom_accessors_unless_conflict() @tags = Struct.new(*.keys)[*.values] unless .empty? end end |
Instance Attribute Details
#ec2_instance ⇒ Object (readonly) Also known as: ec2
Returns the value of attribute ec2_instance.
10 11 12 |
# File 'lib/aws_ro/ec2/instance.rb', line 10 def ec2_instance @ec2_instance end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
10 11 12 |
# File 'lib/aws_ro/ec2/instance.rb', line 10 def @tags end |
Instance Method Details
#running? ⇒ Boolean
26 27 28 |
# File 'lib/aws_ro/ec2/instance.rb', line 26 def running? state.name == 'running' end |