mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
ToHashParser tweaks/cleanup
This commit is contained in:
parent
5abc390c91
commit
cbd78e258c
1 changed files with 6 additions and 4 deletions
|
@ -38,11 +38,13 @@ module Fog
|
|||
end
|
||||
|
||||
def end_element(name)
|
||||
@stack.pop
|
||||
unless @value.empty?
|
||||
last = @stack.pop
|
||||
if last.empty?
|
||||
@stack.last[name.to_sym] = ''
|
||||
elsif @value.empty?
|
||||
@stack.last[name.to_sym] = @value
|
||||
@value = ''
|
||||
end
|
||||
@value = ''
|
||||
end
|
||||
|
||||
def body
|
||||
|
@ -58,7 +60,7 @@ module Fog
|
|||
else
|
||||
key, value = attributes.shift, attributes.shift
|
||||
end
|
||||
parsed_attributes[key.to_sym] = value
|
||||
parsed_attributes[key.to_sym.gsub(':','_')] = value
|
||||
end
|
||||
if @stack.last.is_a?(Array)
|
||||
@stack.last << {name.to_sym => parsed_attributes}
|
||||
|
|
Loading…
Add table
Reference in a new issue