Class: OVIRT::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/rbovirt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, id, href) ⇒ Link

Returns a new instance of Link.



223
224
225
226
# File 'lib/rbovirt.rb', line 223

def initialize(client, id, href)
  @id, @href = id, href
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



221
222
223
# File 'lib/rbovirt.rb', line 221

def client
  @client
end

#hrefObject

Returns the value of attribute href.



221
222
223
# File 'lib/rbovirt.rb', line 221

def href
  @href
end

#idObject

Returns the value of attribute id.



221
222
223
# File 'lib/rbovirt.rb', line 221

def id
  @id
end

Instance Method Details

#followObject



228
229
230
231
232
# File 'lib/rbovirt.rb', line 228

def follow
  xml = Client::parse_response(OVIRT::client(@client.base_url)[@href].get(@client.auth_header))
  object_class = ::OVIRT.const_get(xml.root.name.camelize)
  object_class.new(@client, (xml.root))
end