Class: Elbas::AWS::Instance
- Inherits:
-
Object
- Object
- Elbas::AWS::Instance
- Defined in:
- lib/elbas/aws/instance.rb
Constant Summary collapse
- STATE_RUNNING =
16.freeze
Instance Attribute Summary collapse
-
#aws_counterpart ⇒ Object
readonly
Returns the value of attribute aws_counterpart.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #hostname ⇒ Object
-
#initialize(id, public_dns, state) ⇒ Instance
constructor
A new instance of Instance.
- #running? ⇒ Boolean
Constructor Details
#initialize(id, public_dns, state) ⇒ Instance
Returns a new instance of Instance.
8 9 10 11 12 13 |
# File 'lib/elbas/aws/instance.rb', line 8 def initialize(id, public_dns, state) @id = id @public_dns = public_dns @state = state @aws_counterpart = ::Aws::EC2::Instance.new id end |
Instance Attribute Details
#aws_counterpart ⇒ Object (readonly)
Returns the value of attribute aws_counterpart.
6 7 8 |
# File 'lib/elbas/aws/instance.rb', line 6 def aws_counterpart @aws_counterpart end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/elbas/aws/instance.rb', line 6 def id @id end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/elbas/aws/instance.rb', line 6 def state @state end |
Instance Method Details
#hostname ⇒ Object
15 16 17 |
# File 'lib/elbas/aws/instance.rb', line 15 def hostname @public_dns end |
#running? ⇒ Boolean
19 20 21 |
# File 'lib/elbas/aws/instance.rb', line 19 def running? state == STATE_RUNNING end |