Class: VagrantPlugins::Skytap::API::PublicIp

Inherits:
Resource show all
Includes:
Connectable
Defined in:
lib/vagrant-skytap/api/public_ip.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#attrs, #env

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Connectable

#choice_for_setup, #connection_choice_class

Methods inherited from Resource

#delete, #refresh, #reload, short_name, #update, #url

Methods included from SpecifiedAttributes

#get_api_attribute, included

Constructor Details

#initialize(attrs, interface, env) ⇒ PublicIp

interface may be nil; i.e., this IP isn’t attached to anything.



41
42
43
44
# File 'lib/vagrant-skytap/api/public_ip.rb', line 41

def initialize(attrs, interface, env)
  super
  @interface = interface
end

Instance Attribute Details

#interfaceObject (readonly)

Returns the value of attribute interface.



36
37
38
# File 'lib/vagrant-skytap/api/public_ip.rb', line 36

def interface
  @interface
end

Class Method Details

.rest_nameObject



32
33
34
# File 'lib/vagrant-skytap/api/public_ip.rb', line 32

def self.rest_name
  "public_ip"
end

Instance Method Details

#attached?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/vagrant-skytap/api/public_ip.rb', line 46

def attached?
  interface || nics.present?
end

#deployed?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/vagrant-skytap/api/public_ip.rb', line 50

def deployed?
  nics.any? {|nic_attrs| nic_attrs['deployed']}
end