Class: IControl::Base::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/icontrol/base/sequence.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) elements_class



52
53
54
# File 'lib/icontrol/base/sequence.rb', line 52

def self.elements_class
  instance_eval(name.sub("Sequence",""))
end

+ (Object) from_soap(xml)



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/icontrol/base/sequence.rb', line 56

def self.from_soap(xml)
  aux = [xml[:item]].flatten.map{|i| elements_class.from_soap(i)}
  # If the result is actually an array we return it
  if aux.length > 1 
    return aux
  else
    if aux.length == 1
      # If is just 1 element we return the element
      return aux[0]
    else
      #otherwise is empty so we return a nil 
      nil
    end
  end
end