mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
41 lines
822 B
Ruby
41 lines
822 B
Ruby
![]() |
module Fog
|
||
|
module Parsers
|
||
|
module Voxel
|
||
|
module Compute
|
||
|
|
||
|
class ImagesList < Fog::Parsers::Base
|
||
|
|
||
|
def reset
|
||
|
@image = {}
|
||
|
@response = { :stat => nil, :images => [] }
|
||
|
end
|
||
|
|
||
|
def start_element(name, attrs = [])
|
||
|
super
|
||
|
|
||
|
case name
|
||
|
when 'image'
|
||
|
@image = {
|
||
|
:id => attr_value('id', attrs).to_i,
|
||
|
:name => attr_value('summary', attrs)
|
||
|
}
|
||
|
when 'rsp'
|
||
|
@response[:stat] = attr_value('stat', attrs)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def end_element(name)
|
||
|
case name
|
||
|
when 'image'
|
||
|
@response[:images] << @image
|
||
|
@image = {}
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|