lib/pmp/link.rb in pmp-0.2.1 vs lib/pmp/link.rb in pmp-0.2.2
- old
+ new
@@ -42,11 +42,11 @@
def where(params={})
self.class.new(attributes.merge({'params'=>params}), parent)
end
- def as_json
+ def as_json(options={})
extract_attributes
end
def url
# puts "url href_template: #{href_template}"
@@ -56,10 +56,10 @@
def retrieve
# puts "retrieve method: #{method}"
# puts "retrieve url: #{url}"
# response = parent.request((method || 'get').to_sym, url)
- PMP::CollectionDocument.new(parent.options.merge(href: url))
+ @doc ||= PMP::CollectionDocument.new(parent.options.merge(href: url, root: parent.root))
end
def method_missing(method, *args)
# puts "mm: #{method}"
# this is a method the link supports, call the link