Skip to content
Browse files

Assert that the options argument only contains the :xpath key in Xml.…

…decode method.
  • Loading branch information...
1 parent 8978b53 commit 2218a006b614af1f4918ddfd1f15cb71c5a0e569 Anders Törnqvist committed Jun 15, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/resto/format/xml.rb
View
2 lib/resto/format/xml.rb
@@ -3,6 +3,7 @@
# https://tools.ietf.org/html/rfc3023
require 'resto/format'
require 'nokogiri'
+require 'resto/extra/assert_hash.rb'
module Resto
module Format
@@ -22,6 +23,7 @@ def encode(hash, options = nil)
def decode(xml, options)
xpath = options.fetch(:xpath)
# Converts an XML formatted String to an Array of Hashes.
+ xpath = AssertHash.keys(opts, :xpath).fetch(:xpath)
doc = Nokogiri::XML(xml)
nodes = doc.xpath(xpath)

0 comments on commit 2218a00

Please sign in to comment.
Something went wrong with that request. Please try again.