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

Inherits:
Base
  • Object
show all
Defined in:
lib/rackspace-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

Methods inherited from Hash

#symbolize_keys!

Constructor Details

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

Instance Method Details

#ipObject



417
418
419
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 417

def ip
  self[:ip]
end

#nameObject



413
414
415
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 413

def name
  self[:name] || ip
end

#rnatObject



433
434
435
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 433

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

#rnat_set?Boolean

Returns:

  • (Boolean)


437
438
439
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 437

def rnat_set?
  !!self[:rnat]
end

#statusObject



425
426
427
428
429
430
431
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 425

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

#used_byObject



421
422
423
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 421

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