Method: HP::Cloud::FogCollection#get_array

Defined in:
lib/hpcloud/fog_collection.rb

#get_array(arguments = []) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/hpcloud/fog_collection.rb', line 92

def get_array(arguments = [])
  ray = []
  get(arguments, true).each { |x|
    if x.respond_to?(:to_hash)
      hsh = x.to_hash()
    else
      hsh = Hash[x.attributes.map{ |k, v| [k.to_s, v] }]
    end
    ray << hsh unless hsh.nil?
  }
  return ray
end