Class: Fog::Vcloud::MockDataClasses::MockNetworkIps

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

#itemsObject



396
397
398
399
400
# File 'lib/fog/vcloud/mock_data_classes.rb', line 396

def items
  @items ||= _parent.usable_subnet_ips.inject({}) do |out, subnet_ip|
    out.update(subnet_ip => MockNetworkIp.new({ :ip => subnet_ip }, self))
  end
end

#nameObject



406
407
408
# File 'lib/fog/vcloud/mock_data_classes.rb', line 406

def name
  "IP Addresses"
end

#ordered_ipsObject



402
403
404
# File 'lib/fog/vcloud/mock_data_classes.rb', line 402

def ordered_ips
  items.values.sort_by {|i| i.ip.split(".").map(&:to_i) }
end