Class: DeltacloudVM::Client::InstanceAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/deltacloud_vm/client/models/instance_address.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value) ⇒ InstanceAddress

Returns a new instance of InstanceAddress.



21
22
23
24
# File 'lib/deltacloud_vm/client/models/instance_address.rb', line 21

def initialize(type, value)
  @type = type
  @value = value
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



19
20
21
# File 'lib/deltacloud_vm/client/models/instance_address.rb', line 19

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



19
20
21
# File 'lib/deltacloud_vm/client/models/instance_address.rb', line 19

def value
  @value
end

Class Method Details

.convert(address_xml_block) ⇒ Object



34
35
36
37
38
# File 'lib/deltacloud_vm/client/models/instance_address.rb', line 34

def self.convert(address_xml_block)
  address_xml_block.map do |addr|
    new(:ip_address, addr.text)
  end
end

Instance Method Details

#[](attr) ⇒ Object



26
27
28
# File 'lib/deltacloud_vm/client/models/instance_address.rb', line 26

def [](attr)
  instance_variable_get("@#{attr}")
end

#to_sObject



30
31
32
# File 'lib/deltacloud_vm/client/models/instance_address.rb', line 30

def to_s
  @value
end