Skip to content

Commit

Permalink
Only need to do one regex substitution for atom:
Browse files Browse the repository at this point in the history
  • Loading branch information
idris committed Nov 4, 2010
1 parent 914d6b5 commit 3c12ba7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/constant_contact/formats/atom_format.rb
Expand Up @@ -17,10 +17,7 @@ def encode(hash, options={})
end

def decode(xml)
if xml =~ /\<atom\:/
xml.gsub!( /\<atom\:/, '<' )
xml.gsub!( /\<\/atom\:/, '</' )
end
xml.gsub!( /\<(\/?)atom\:/, '<\1' ) # the "events" feeds have "atom:" in front of tags, for some reason
return [] if no_content?(xml)
result = Hash.from_xml(from_atom_data(xml))
is_collection?(xml) ? result['records'] : result.values.first
Expand Down

0 comments on commit 3c12ba7

Please sign in to comment.