Class: HTTP::Session
- Inherits:
-
Object
- Object
- HTTP::Session
- Includes:
- Configurable, Requestable, MonitorMixin
- Defined in:
- lib/http/session.rb,
lib/http/session/cache.rb,
lib/http/session/client.rb,
lib/http/session/options.rb,
lib/http/session/request.rb,
lib/http/session/version.rb,
lib/http/session/response.rb,
lib/http/session/cache/entry.rb,
lib/http/session/requestable.rb,
lib/http/session/cache/status.rb,
lib/http/session/configurable.rb,
lib/http/session/client/perform.rb,
lib/http/session/cache/cache_control.rb,
lib/http/session/options/cache_option.rb,
lib/http/session/response/string_body.rb,
lib/http/session/features/auto_inflate.rb,
lib/http/session/options/cookies_option.rb
Overview
Use session to manage cookies and cache across requests.
Defined Under Namespace
Modules: Configurable, Features, Requestable Classes: Cache, Client, Options, Request, Response
Constant Summary collapse
- VERSION =
"1.0.1"
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
-
#jar ⇒ Object
readonly
Returns the value of attribute jar.
Instance Method Summary collapse
-
#initialize(default_options = {}) ⇒ Session
constructor
A new instance of Session.
- #request(verb, uri, opts = {}) ⇒ Response
Methods included from Requestable
#connect, #delete, #get, #head, #options, #patch, #post, #put, #trace
Methods included from Configurable
#accept, #auth, #basic_auth, #cookies, #encoding, #follow, #headers, #nodelay, #timeout, #use, #via
Constructor Details
#initialize(default_options = {}) ⇒ Session
Returns a new instance of Session.
43 44 45 46 47 48 49 |
# File 'lib/http/session.rb', line 43 def initialize( = {}) super() @default_options = HTTP::Session::Options.new() @cache = HTTP::Session::Cache.new(@default_options.cache) @jar = HTTP::CookieJar.new end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
33 34 35 |
# File 'lib/http/session.rb', line 33 def cache @cache end |
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
29 30 31 |
# File 'lib/http/session.rb', line 29 def @default_options end |
#jar ⇒ Object (readonly)
Returns the value of attribute jar.
37 38 39 |
# File 'lib/http/session.rb', line 37 def jar @jar end |