Class: VCloud::Link

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/vcloud/user/link.rb

Overview

Defines a hyper-link with a relationship, hyper-link reference, and an optional MIME type

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Link

A new instance of Link

Parameters:

  • args (Hash{String => String}) (defaults to: {})

    Named arguments, ‘rel’, ‘type’, ‘name’ and ‘href’



15
16
17
18
19
20
# File 'lib/vcloud/user/link.rb', line 15

def initialize(args = {})
  @rel = args[:rel]
  @type = args[:type]
  @name = args[:name]
  @href = args[:href]
end

Class Method Details

.from_xml(xml) ⇒ VCloud::Link

Parses XML to produce a VCloud::Link

Parameters:

  • xml (String)

    XML to parse

Returns:



26
27
28
# File 'lib/vcloud/user/link.rb', line 26

def self.from_xml(xml)
  parse(xml)
end