lib/decontaminate/decontaminator.rb in decontaminate-0.1.0 vs lib/decontaminate/decontaminator.rb in decontaminate-0.1.1
- old
+ new
@@ -33,10 +33,10 @@
decoder = Decontaminate::Decoder::Array.new(resolved_path, singular)
add_decoder key, decoder
end
- def hash(xpath, key: infer_key(xpath), &body)
+ def hash(xpath = '.', key: infer_key(xpath), &body)
decontaminator = Class.new(Decontaminate::Decontaminator, &body)
add_decoder key, Decontaminate::Decoder::Hash.new(xpath, decontaminator)
end
def hashes(xpath = nil, path: nil, key: nil, &body)