Class: Fog::Vcloud::MockDataClasses::MockNetworkIp

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/vcloud/mock_data_classes.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::Vcloud::MockDataClasses::Base

Instance Method Details

#ipObject



418
419
420
# File 'lib/fog/vcloud/mock_data_classes.rb', line 418

def ip
  self[:ip]
end

#nameObject



414
415
416
# File 'lib/fog/vcloud/mock_data_classes.rb', line 414

def name
  self[:name] || ip
end

#rnatObject



434
435
436
# File 'lib/fog/vcloud/mock_data_classes.rb', line 434

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

#statusObject



426
427
428
429
430
431
432
# File 'lib/fog/vcloud/mock_data_classes.rb', line 426

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

#used_byObject



422
423
424
# File 'lib/fog/vcloud/mock_data_classes.rb', line 422

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