Class: Cliaws::Ec2::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/cliaws/ec2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_data) ⇒ Instance

Returns a new instance of Instance.



55
56
57
# File 'lib/cliaws/ec2.rb', line 55

def initialize(raw_data)
  @raw_data = raw_data
end

Instance Attribute Details

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



53
54
55
# File 'lib/cliaws/ec2.rb', line 53

def raw_data
  @raw_data
end

Instance Method Details

#groupsObject



79
80
81
# File 'lib/cliaws/ec2.rb', line 79

def groups
  @raw_data[:aws_groups]
end

#instance_idObject



63
64
65
# File 'lib/cliaws/ec2.rb', line 63

def instance_id
  @raw_data[:aws_instance_id]
end

#private_dns_nameObject



71
72
73
# File 'lib/cliaws/ec2.rb', line 71

def private_dns_name
  @raw_data[:aws_private_dns_name]
end

#public_dns_nameObject



67
68
69
# File 'lib/cliaws/ec2.rb', line 67

def public_dns_name
  @raw_data[:dns_name]
end

#running?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/cliaws/ec2.rb', line 59

def running?
  @raw_data[:aws_state] == "running"
end

#stateObject



75
76
77
# File 'lib/cliaws/ec2.rb', line 75

def state
  @raw_data[:aws_state]
end