Module: Fetch
- Defined in:
- lib/fetch/base.rb,
lib/fetch.rb,
lib/fetch/json.rb,
lib/fetch/async.rb,
lib/fetch/module.rb,
lib/fetch/simple.rb,
lib/fetch/request.rb,
lib/fetch/version.rb,
lib/fetch/callbacks.rb,
lib/fetch/backend/base.rb,
lib/fetch/configuration.rb,
lib/fetch/backend/typhoeus.rb
Overview
Base module for fetch handlers, e.g. ProductFetch
, UserFetch
, etc.
Defined Under Namespace
Modules: Async, Backend, Callbacks, JSON, Simple Classes: Base, Configuration, HttpError, Module, Request
Constant Summary collapse
- VERSION =
"0.0.5"
Class Method Summary collapse
-
.config ⇒ Object
Returns a configuration object.
-
.configure {|config| ... } ⇒ Object
Yields a configuration block (
Fetch::Configuration
). - .module_cache ⇒ Object
Class Method Details
.config ⇒ Object
Returns a configuration object.
33 34 35 |
# File 'lib/fetch.rb', line 33 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
Yields a configuration block (Fetch::Configuration
).
Fetch.configure do |config|
config.user_agent = "Custom User Agent"
end
42 43 44 |
# File 'lib/fetch.rb', line 42 def configure(&block) yield config end |
.module_cache ⇒ Object
46 47 48 |
# File 'lib/fetch.rb', line 46 def module_cache @module_cache ||= ModuleCache.new end |