Class: Fog::Compute::Linode::Ip

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/linode/models/compute/ip.rb

Instance Method Summary collapse

Instance Method Details

#saveObject

Raises:

  • (Fog::Errors::Error)

11
12
13
14
15
16
17
# File 'lib/fog/linode/models/compute/ip.rb', line 11

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

#serverObject


19
20
21
# File 'lib/fog/linode/models/compute/ip.rb', line 19

def server
  @server
end