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
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/openstack/models/compute/networks.rb
fog-1.32.0 lib/fog/openstack/models/compute/networks.rb
fog-1.31.0 lib/fog/openstack/models/compute/networks.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/openstack/models/compute/networks.rb
fog-1.30.0 lib/fog/openstack/models/compute/networks.rb
fog-1.29.0 lib/fog/openstack/models/compute/networks.rb
fog-1.28.0 lib/fog/openstack/models/compute/networks.rb
fog-1.27.0 lib/fog/openstack/models/compute/networks.rb
fog-1.26.0 lib/fog/openstack/models/compute/networks.rb
fog-1.25.0 lib/fog/openstack/models/compute/networks.rb
nsidc-fog-1.24.1 lib/fog/openstack/models/compute/networks.rb
fog-1.24.0 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.11 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.10 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.9 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.8 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.7 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.6 lib/fog/openstack/models/compute/networks.rb
fog-1.23.0 lib/fog/openstack/models/compute/networks.rb
ns-fog-1.22.4 lib/fog/openstack/models/compute/networks.rb