1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add some attributes that are implemented as methods.

This commit is contained in:
Rupak Ganguly 2012-01-31 18:26:13 -05:00
parent 897e48d09f
commit 4498879c7a

View file

@ -24,6 +24,11 @@ module Fog
attribute :tenant_id
attribute :user_id
attribute :key_name
# these are implemented as methods
attribute :image_id
attribute :flavor_id
attribute :private_ip_address
attribute :public_ip_address
attr_reader :password
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username, :image_id, :flavor_id
@ -48,7 +53,8 @@ module Fog
end
def private_ip_address
addresses.nil? ? nil : addresses['private'].first
addr = addresses.nil? ? nil : addresses.fetch('private', []).first
addr["addr"] if addr
end
def private_key_path
@ -61,7 +67,8 @@ module Fog
end
def public_ip_address
addresses.nil? ? nil : addresses['public'].first
addr = addresses.nil? ? nil : addresses.fetch('public', []).first
addr["addr"] if addr
end
def public_key_path