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

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

Instance Method Details

#ipObject



415
416
417
# File 'lib/fog/ecloud/mock_data_classes.rb', line 415

def ip
  self[:ip]
end

#nameObject



411
412
413
# File 'lib/fog/ecloud/mock_data_classes.rb', line 411

def name
  self[:name] || ip
end

#rnatObject



431
432
433
# File 'lib/fog/ecloud/mock_data_classes.rb', line 431

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

#rnat_set?Boolean

Returns:

  • (Boolean)


435
436
437
# File 'lib/fog/ecloud/mock_data_classes.rb', line 435

def rnat_set?
  !!self[:rnat]
end

#statusObject



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

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

#used_byObject



419
420
421
# File 'lib/fog/ecloud/mock_data_classes.rb', line 419

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