lib/sucker/response.rb in sucker-0.6.5 vs lib/sucker/response.rb in sucker-0.6.6
- old
+ new
@@ -9,11 +9,10 @@
self.code = curl.response_code
self.time = curl.total_time
end
def to_h
- doc = Nokogiri::XML(body)
- content_to_string(doc.to_hash)
+ @hash ||= content_to_string(Nokogiri::XML(body).to_hash)
end
alias :to_hash :to_h
private