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-2.3.0 lib/fog/linode/models/compute/ip.rb
fog-ifeel-2.2.0 lib/fog/linode/models/compute/ip.rb
fog-2.2.0 lib/fog/linode/models/compute/ip.rb
fog-2.1.0 lib/fog/linode/models/compute/ip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/linode/models/compute/ip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/linode/models/compute/ip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/linode/models/compute/ip.rb
fog-1.42.1 lib/fog/linode/models/compute/ip.rb
fog-2.0.0 lib/fog/linode/models/compute/ip.rb
fog-1.42.0 lib/fog/linode/models/compute/ip.rb
fog-1.41.0 lib/fog/linode/models/compute/ip.rb
fog-1.40.0 lib/fog/linode/models/compute/ip.rb
fog-1.39.0 lib/fog/linode/models/compute/ip.rb
fog-1.38.0 lib/fog/linode/models/compute/ip.rb
fog-1.37.0 lib/fog/linode/models/compute/ip.rb
fog-1.36.0 lib/fog/linode/models/compute/ip.rb
fog-1.35.0 lib/fog/linode/models/compute/ip.rb
fog-2.0.0.pre.0 lib/fog/linode/models/compute/ip.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/linode/models/compute/ip.rb
fog-1.34.0 lib/fog/linode/models/compute/ip.rb