Skip to content

Commit bd1c567

Browse files
committed
.to_i
1 parent a497664 commit bd1c567

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/cortex/result.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def parse_headers(headers)
2323
end
2424
if headers['content-range']
2525
matches = headers['content-range'].match(/^(\w+) (\d+)\-(\d+):(\d+)\/\d+$/i)
26-
@per_page = matches[4]
27-
@range_start = matches[2]
28-
@range_end = matches[3]
26+
@per_page = matches[4].to_i
27+
@range_start = matches[2].to_i
28+
@range_end = matches[3].to_i
2929
@range = "#{@range_start}-#{@range_end}"
30-
@page = (@range_end.to_i / @per_page.to_i) + 1
30+
@page = (@range_end / @per_page) + 1
3131
end
3232
end
3333

0 commit comments

Comments
 (0)