lib/spidr/session_cache.rb in spidr-0.6.1 vs lib/spidr/session_cache.rb in spidr-0.7.0
- old
+ new
@@ -15,40 +15,42 @@
include Settings::Timeouts
#
# Creates a new session cache.
#
- # @param [Hash] options
- # Configuration options.
- #
- # @option [Hash] :proxy (Spidr.proxy)
+ # @param [Hash] proxy
# Proxy options.
#
- # @option [Integer] :open_timeout (Spidr.open_timeout)
- # Optional open timeout.
+ # @param [Integer] open_timeout
+ # Optional open connection timeout.
#
- # @option [Integer] :ssl_timeout (Spidr.ssl_timeout)
- # Optional ssl timeout.
+ # @param [Integer] ssl_timeout
+ # Optional SSL connection timeout.
#
- # @option [Integer] :read_timeout (Spidr.read_timeout)
+ # @param [Integer] read_timeout
# Optional read timeout.
#
- # @option [Integer] :continue_timeout (Spidr.continue_timeout)
+ # @param [Integer] continue_timeout
# Optional `Continue` timeout.
#
- # @option [Integer] :keep_alive_timeout (Spidr.keep_alive_timeout)
+ # @param [Integer] keep_alive_timeout
# Optional `Keep-Alive` timeout.
#
# @since 0.6.0
#
- def initialize(options={})
- @proxy = options.fetch(:proxy,Spidr.proxy)
+ def initialize(proxy: Spidr.proxy,
+ open_timeout: Spidr.open_timeout,
+ ssl_timeout: Spidr.ssl_timeout,
+ read_timeout: Spidr.read_timeout,
+ continue_timeout: Spidr.continue_timeout,
+ keep_alive_timeout: Spidr.keep_alive_timeout)
+ self.proxy = proxy
- @open_timeout = options.fetch(:open_timeout,Spidr.open_timeout)
- @ssl_timeout = options.fetch(:ssl_timeout,Spidr.ssl_timeout)
- @read_timeout = options.fetch(:read_timeout,Spidr.read_timeout)
- @continue_timeout = options.fetch(:continue_timeout,Spidr.continue_timeout)
- @keep_alive_timeout = options.fetch(:keep_alive_timeout,Spidr.keep_alive_timeout)
+ self.open_timeout = open_timeout
+ self.ssl_timeout = ssl_timeout
+ self.read_timeout = read_timeout
+ self.continue_timeout = continue_timeout
+ self.keep_alive_timeout = keep_alive_timeout
@sessions = {}
end
#