Class: OpenNebula::PoolElement

Inherits:
XMLElement show all
Defined in:
lib/OpenNebula/Pool.rb

Overview

The PoolElement Class represents a generic element of a Pool in XML format

Direct Known Subclasses

Acl, Group, Host, Image, Template, User, VirtualMachine, VirtualNetwork

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XMLElement

#[], #attr, build_xml, #each, #each_xpath, #has_elements?, #initialize_xml, #retrieve_elements, #template_like_str, #template_str, #text, #to_hash, #to_xml

Class Method Details

.new_with_id(id, client = nil) ⇒ Object

Creates new element specifying its id id:: identifyier of the element client:: initialized OpenNebula::Client object



261
262
263
# File 'lib/OpenNebula/Pool.rb', line 261

def self.new_with_id(id, client=nil)
    self.new(self.build_xml(id), client)
end

Instance Method Details

#idObject

Returns element identifier [return] Integer the PoolElement ID



267
268
269
# File 'lib/OpenNebula/Pool.rb', line 267

def id
    @pe_id
end

#nameObject

Gets element name [return] String the PoolElement name



273
274
275
# File 'lib/OpenNebula/Pool.rb', line 273

def name
    @name
end

#to_strObject

DO NOT USE - ONLY REXML BACKEND



278
279
280
281
282
283
# File 'lib/OpenNebula/Pool.rb', line 278

def to_str
    str = ""
    REXML::Formatters::Pretty.new(1).write(@xml,str)

    return str
end