Class: VCloudSdk::Xml::Item

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/ruby_vcloud_sdk/xml/wrapper_classes/item.rb

Direct Known Subclasses

HardDiskItemWrapper, NicItemWrapper

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #edit_link, #get_nodes, #href, #href=, #href_id, #initialize, #name, #name=, #power_off_link, #power_on_link, #remove_link, #running_tasks, #to_s, #type, #type=, #undeploy_link, #urn, #xpath

Constructor Details

This class inherits a constructor from VCloudSdk::Xml::Wrapper

Instance Method Details

#add_rasd(name) ⇒ Object



4
5
6
7
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/item.rb', line 4

def add_rasd(name)
  raise "Cannot add duplicate RASD element #{name}." if get_rasd(name)
  add_child(name, "rasd", RASD)
end

#get_rasd(name) ⇒ Object



9
10
11
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/item.rb', line 9

def get_rasd(name)
  get_nodes(name, nil, true, RASD).first
end

#get_rasd_content(name) ⇒ Object



13
14
15
16
17
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/item.rb', line 13

def get_rasd_content(name)
  node = get_rasd(name)
  return node.content if node
  nil
end

#set_rasd(name, value) ⇒ Object



19
20
21
22
23
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/item.rb', line 19

def set_rasd(name, value)
  node = get_rasd(name)
  fail "The RASD element #{name} does not exist." unless node
  node.content = value
end