lib/pmp/token.rb in pmp-0.4.0 vs lib/pmp/token.rb in pmp-0.4.1

- old
+ new

@@ -12,11 +12,11 @@ yield(self) if block_given? end def token_url - options['token_url'] || '/auth/access_token' + root_document.auth['urn:collectiondoc:form:issuetoken'].url end def get_token oauth_options = { site: endpoint, @@ -46,9 +46,13 @@ }.merge(opts) options[:headers] = options[:headers].merge(headers) # clean out any that don't belong options.select{|k,v| PMP::Connection::ALLOWED_CONNECTION_OPTIONS.include?(k.to_sym)} + end + + def root_document + @root ||= PMP::CollectionDocument.new(current_options.merge(href: endpoint)) end end end