Class: Mulder::Instance
- Inherits:
-
Object
- Object
- Mulder::Instance
- Defined in:
- lib/mulder/instance.rb
Instance Attribute Summary collapse
-
#fog_compute_instance ⇒ Object
readonly
Returns the value of attribute fog_compute_instance.
Instance Method Summary collapse
- #as_hash ⇒ Object
- #availability_zone ⇒ Object
- #created_at ⇒ Object
- #dns_name ⇒ Object
- #exists? ⇒ Boolean
- #id ⇒ Object
-
#initialize(fog_compute_instance) ⇒ Instance
constructor
A new instance of Instance.
- #private_ip_address ⇒ Object
- #public_ip_address ⇒ Object
- #vpc_id ⇒ Object
Constructor Details
#initialize(fog_compute_instance) ⇒ Instance
Returns a new instance of Instance.
8 9 10 |
# File 'lib/mulder/instance.rb', line 8 def initialize(fog_compute_instance) @fog_compute_instance = fog_compute_instance end |
Instance Attribute Details
#fog_compute_instance ⇒ Object (readonly)
Returns the value of attribute fog_compute_instance.
6 7 8 |
# File 'lib/mulder/instance.rb', line 6 def fog_compute_instance @fog_compute_instance end |
Instance Method Details
#as_hash ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mulder/instance.rb', line 44 def as_hash @as_hash ||= { id: id, dns_name: dns_name, public_ip_address: public_ip_address, private_ip_address: private_ip_address, availability_zone: availability_zone, vpc_id: vpc_id, created_at: created_at }.delete_if { |_, value| value == '' || value == nil } end |
#availability_zone ⇒ Object
28 29 30 |
# File 'lib/mulder/instance.rb', line 28 def availability_zone @fog_compute_instance.availability_zone end |
#created_at ⇒ Object
36 37 38 |
# File 'lib/mulder/instance.rb', line 36 def created_at @fog_compute_instance.created_at end |
#dns_name ⇒ Object
16 17 18 |
# File 'lib/mulder/instance.rb', line 16 def dns_name @fog_compute_instance.dns_name end |
#exists? ⇒ Boolean
40 41 42 |
# File 'lib/mulder/instance.rb', line 40 def exists? !@fog_compute_instance.nil? end |
#id ⇒ Object
12 13 14 |
# File 'lib/mulder/instance.rb', line 12 def id @fog_compute_instance.id end |
#private_ip_address ⇒ Object
24 25 26 |
# File 'lib/mulder/instance.rb', line 24 def private_ip_address @fog_compute_instance.private_ip_address end |
#public_ip_address ⇒ Object
20 21 22 |
# File 'lib/mulder/instance.rb', line 20 def public_ip_address @fog_compute_instance.public_ip_address end |
#vpc_id ⇒ Object
32 33 34 |
# File 'lib/mulder/instance.rb', line 32 def vpc_id @fog_compute_instance.vpc_id end |