Class: Fog::Ecloud::MockDataClasses::MockNetworkIp

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/ecloud/compute.rb

Instance Method Summary collapse

Methods inherited from Base

#_parent, base_url, #base_url, base_url=, #first, #href, #initialize, #inspect, #last

Constructor Details

This class inherits a constructor from Fog::Ecloud::MockDataClasses::Base

Instance Method Details

#ipObject



444
445
446
# File 'lib/fog/ecloud/compute.rb', line 444

def ip
  self[:ip]
end

#nameObject



440
441
442
# File 'lib/fog/ecloud/compute.rb', line 440

def name
  self[:name] || ip
end

#rnatObject



460
461
462
# File 'lib/fog/ecloud/compute.rb', line 460

def rnat
  self[:rnat] || _parent._parent.rnat
end

#rnat_set?Boolean

Returns:

  • (Boolean)


464
465
466
# File 'lib/fog/ecloud/compute.rb', line 464

def rnat_set?
  !!self[:rnat]
end

#statusObject



452
453
454
455
456
457
458
# File 'lib/fog/ecloud/compute.rb', line 452

def status
  if used_by
    "Assigned"
  else
    "Available"
  end
end

#used_byObject



448
449
450
# File 'lib/fog/ecloud/compute.rb', line 448

def used_by
  self[:used_by] || _parent._parent._parent.virtual_machines.detect {|v| v.ip == ip }
end