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

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/compute/ecloud.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



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

def ip
  self[:ip]
end

#nameObject



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

def name
  self[:name] || ip
end

#rnatObject



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

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

#rnat_set?Boolean

Returns:

  • (Boolean)


468
469
470
# File 'lib/fog/compute/ecloud.rb', line 468

def rnat_set?
  !!self[:rnat]
end

#statusObject



456
457
458
459
460
461
462
# File 'lib/fog/compute/ecloud.rb', line 456

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

#used_byObject



452
453
454
# File 'lib/fog/compute/ecloud.rb', line 452

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