Skip to content

Commit 47f3bd3

Browse files
gcolsonbarmintor
authored andcommitted
allow to pass expiration date and total when parsing a token
1 parent f9788d6 commit 47f3bd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/oai/provider/resumption_token.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ResumptionToken
3636
attr_reader :prefix, :set, :from, :until, :last, :last_str, :expiration, :total
3737

3838
# parses a token string and returns a ResumptionToken
39-
def self.parse(token_string)
39+
def self.parse(token_string, expiration = nil, total = nil)
4040
begin
4141
options = {}
4242
matches = /(.+):([^ :]+)$/.match(token_string)
@@ -54,7 +54,7 @@ def self.parse(token_string)
5454
options[:until] = Time.parse(part.sub(/^u\(/, '').sub(/\)$/, '')).localtime
5555
end
5656
end
57-
self.new(options)
57+
self.new(options, expiration, total)
5858
rescue => err
5959
raise OAI::ResumptionTokenException.new
6060
end

0 commit comments

Comments
 (0)