Class: VCloud::Reference

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

Overview

A reference to a resource. Contains an href attribute and optional name and type attributes.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Reference

Returns a new instance of Reference.



12
13
14
15
16
17
# File 'lib/vcloud/user/reference.rb', line 12

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

Class Method Details

.from_xml(xml) ⇒ VCloud::Reference

Parse a VCloud::Reference from XML

Parameters:

  • xml (String)

    XML to parse

Returns:



23
24
25
# File 'lib/vcloud/user/reference.rb', line 23

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