Sha256: c004d0e9fb620a56eeb06e425c007b56b6ec02a0e59b89656d95cc819f210ac8

Contents?: true

Size: 692 Bytes

Versions: 107

Compression:

Stored size: 692 Bytes

Contents

require 'fog/core/collection'
require 'fog/openstack/models/compute/network'

module Fog
  module Compute
    class OpenStack
      class Networks < Fog::Collection
        model Fog::Compute::OpenStack::Network

        attribute :server

        def all
          requires :server

          networks = Array.new
          server.addresses.each_with_index do |address, index|
            networks << {
              :id   => index + 1,
              :name => address[0],
              :addresses => address[1].map {|a| a['addr'] }
            }
          end

          load(networks)
        end
      end # class Networks
    end # class OpenStack
  end # module Compute
end # module Fog

Version data entries

107 entries across 107 versions & 15 rubygems

Version Path
fog-sgonyea-1.8.1 lib/fog/openstack/models/compute/networks.rb
fog-1.8.0 lib/fog/openstack/models/compute/networks.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/openstack/models/compute/networks.rb
fog-1.7.0 lib/fog/openstack/models/compute/networks.rb
fog-1.6.0 lib/fog/openstack/models/compute/networks.rb
fog-1.5.0 lib/fog/openstack/models/compute/networks.rb
fog-1.4.0 lib/fog/openstack/models/compute/networks.rb