Skip to content

Commit 56da45d

Browse files
authored
Merge pull request #65 from code4lib/avoid_fixnum
Avoid deprecations on `Fixnum` class by not using it.
2 parents 5cf2baa + a70b696 commit 56da45d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/oai/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ def initialize(base_url, options={})
9292
@http_client = options.fetch(:http) do
9393
Faraday.new(:url => @base.clone) do |builder|
9494
follow_redirects = options.fetch(:redirects, true)
95-
if follow_redirects
96-
count = follow_redirects.is_a?(Fixnum) ? follow_redirects : 5
95+
follow_redirects = 5 if follow_redirects == true
9796

97+
if follow_redirects
9898
require 'faraday_middleware'
99-
builder.response :follow_redirects, :limit => count
99+
builder.response :follow_redirects, :limit => follow_redirects.to_i
100100
end
101101
builder.adapter :net_http
102102
end

0 commit comments

Comments
 (0)