Class: OpenNebula::Pool

Inherits:
XMLPool show all
Includes:
Enumerable
Defined in:
lib/opennebula/pool.rb

Overview

The Pool class represents a generic OpenNebula Pool in XML format and provides the basic functionality to handle the Pool elements

Constant Summary collapse

INFO_GROUP =

Constants for info queries (include/RequestManagerPoolInfoFilter.h)

-1
INFO_ALL =
-2
INFO_MINE =
-3

Instance Method Summary collapse

Methods inherited from XMLPool

#each_element

Methods inherited from XMLElement

#[], #add_element, #attr, build_xml, #delete_element, #each_xpath, #element_xml, #has_elements?, #initialize_xml, #name, #retrieve_elements, #template_like_str, #template_str, #template_xml, #text, #to_hash, #to_xml

Instance Method Details

#each(&block) ⇒ Object

Iterates over every PoolElement in the Pool and calls the block with a a PoolElement obtained calling the factory method

block

Block



148
149
150
# File 'lib/opennebula/pool.rb', line 148

def each(&block)
    each_element(block) if @xml
end

#each_with_xpathObject



25
# File 'lib/opennebula/pool.rb', line 25

alias_method :each_with_xpath, :each

#to_strObject

DO NOT USE - ONLY REXML BACKEND



153
154
155
156
157
158
# File 'lib/opennebula/pool.rb', line 153

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

    return str
end