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



416
417
418
# File 'lib/fog/vcloud/mock_data_classes.rb', line 416

def ip
  self[:ip]
end

#nameObject



412
413
414
# File 'lib/fog/vcloud/mock_data_classes.rb', line 412

def name
  self[:name] || ip
end

#rnatObject



432
433
434
# File 'lib/fog/vcloud/mock_data_classes.rb', line 432

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

#rnat_set?Boolean

Returns:

  • (Boolean)


436
437
438
# File 'lib/fog/vcloud/mock_data_classes.rb', line 436

def rnat_set?
  !!self[:rnat]
end

#statusObject



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

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

#used_byObject



420
421
422
# File 'lib/fog/vcloud/mock_data_classes.rb', line 420

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