Sha256: 42420cfd0a69b79dfb3ec8af1af53d2d479351840b7ddfa4599fb4ce4a6ae166

Contents?: true

Size: 594 Bytes

Versions: 108

Compression:

Stored size: 594 Bytes

Contents

require 'fog/core/model'

module Fog
  module Compute
    class Linode
      class Ip < Fog::Model
        identity :id
        attribute :ip
        attribute :public

        def save
          requires :server
          raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?

          service.linode_ip_addprivate server.id
          server.ips.all.find { |ip| !ip.public }
        end

        def server
          @server
        end

        private
        def server=(server)
          @server = server
        end
      end
    end
  end
end

Version data entries

108 entries across 106 versions & 11 rubygems

Version Path
fog-1.18.0 lib/fog/linode/models/compute/ip.rb
fog-1.17.0 lib/fog/linode/models/compute/ip.rb
fog-1.16.0 lib/fog/linode/models/compute/ip.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/linode/models/compute/ip.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/linode/models/compute/ip.rb
fog-1.15.0 lib/fog/linode/models/compute/ip.rb
gapinc-fog-1.14.0 lib/fog/linode/models/compute/ip.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/linode/models/compute/ip.rb
fog-1.14.0 lib/fog/linode/models/compute/ip.rb
fog-1.13.0 lib/fog/linode/models/compute/ip.rb
gapinc-fog-1.12.1.2 lib/fog/linode/models/compute/ip.rb
gapinc-fog-1.12.1.1 lib/fog/linode/models/compute/ip.rb
gapinc-fog-1.12.1a lib/fog/linode/models/compute/ip.rb
gapinc-fog-1.12.1 lib/fog/linode/models/compute/ip.rb
fog-1.12.1 lib/fog/linode/models/compute/ip.rb
fog-1.12.0 lib/fog/linode/models/compute/ip.rb
hpfog-0.0.20 lib/fog/linode/models/compute/ip.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/linode/models/compute/ip.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/linode/models/compute/ip.rb
fog-1.11.1 lib/fog/linode/models/compute/ip.rb