Class: Elbas::AWS::Instance

Inherits:
Base
  • Object
show all
Defined in:
lib/elbas/aws/instance.rb

Constant Summary collapse

STATE_RUNNING =
16.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#aws_access_key, #aws_client, aws_client, #aws_credentials, #aws_region, #aws_secret_key

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_namespace::Instance.new id, client: aws_client
end

Instance Attribute Details

#aws_counterpartObject (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

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/elbas/aws/instance.rb', line 6

def id
  @id
end

#stateObject (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

#hostnameObject



15
16
17
# File 'lib/elbas/aws/instance.rb', line 15

def hostname
  @public_dns
end

#running?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/elbas/aws/instance.rb', line 19

def running?
  state == STATE_RUNNING
end