lib/hwacha/config.rb in hwacha-0.3.0 vs lib/hwacha/config.rb in hwacha-1.0.0
- old
+ new
@@ -1,17 +1,27 @@
require 'ostruct'
class Hwacha
class Config < OpenStruct
- def options
+ def hydra_options
options = {}
options.merge(concurrency_option)
end
+ def request_options
+ options = {}
+ options.merge(follow_redirects_option)
+ end
+
private
def concurrency_option
return {} if max_concurrent_requests.nil?
{ :max_concurrency => max_concurrent_requests }
+ end
+
+ def follow_redirects_option
+ return { :followlocation => false } if follow_redirects.nil?
+ { :followlocation => !!follow_redirects }
end
end
end