Class: ChimeraHttpClient::Base
- Inherits:
-
Object
- Object
- ChimeraHttpClient::Base
- Defined in:
- lib/chimera_http_client/base.rb
Direct Known Subclasses
Constant Summary collapse
- USER_AGENT =
"ChimeraHttpClient (by mediafinger)".freeze
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/chimera_http_client/base.rb', line 5 def initialize( = {}) fail(ChimeraHttpClient::ParameterMissingError, "base_url expected, but not given") if [:base_url].nil? @base_url = .fetch(:base_url) @deserializer = default_deserializer.merge(.fetch(:deserializer, {})) @logger = [:logger] @monitor = [:monitor] @timeout = [:timeout] Typhoeus::Config.cache = [:cache] Typhoeus::Config.memoize = false # hydra setting, prevents a possible memory leak Typhoeus::Config.user_agent = .fetch(:user_agent, USER_AGENT) Typhoeus::Config.verbose = .fetch(:verbose, false) end |