lib/excon/hypermedia/response.rb in excon-hypermedia-0.5.2 vs lib/excon/hypermedia/response.rb in excon-hypermedia-0.5.3

- old
+ new

@@ -56,22 +56,18 @@ unless (link = resource._links[name]) raise UnknownRelationError, "unknown relation: #{name}" end - options = rel_params(name, params.first.to_h) + options = rel_params(params.first.to_h) link.respond_to?(:to_ary) ? link.map { |l| l.rel(options) } : link.rel(options) end - def rel_params(name, params) + def rel_params(params) params.merge( hcp: (params[:hcp].nil? ? response.data[:hcp] : params[:hcp]), - hcp_params: { - content_type: response.headers['Content-Type'], - embedded: resource._embedded.to_h, - relation: name - }, + embedded: resource._embedded.to_h, hypermedia: true ) end end end