Class: Typhoeus::Request
- Inherits:
-
Object
- Object
- Typhoeus::Request
- Extended by:
- Actions
- Includes:
- Before, BlockConnection, Callbacks, Callbacks::Types, Marshal, Memoizable, Operations, Responseable, Stubbable
- Defined in:
- lib/typhoeus/request.rb,
lib/typhoeus/request/before.rb,
lib/typhoeus/request/actions.rb,
lib/typhoeus/request/marshal.rb,
lib/typhoeus/request/callbacks.rb,
lib/typhoeus/request/stubbable.rb,
lib/typhoeus/request/memoizable.rb,
lib/typhoeus/request/operations.rb,
lib/typhoeus/request/responseable.rb,
lib/typhoeus/request/block_connection.rb
Overview
This class represents a request.
Defined Under Namespace
Modules: Actions, Before, BlockConnection, Callbacks, Marshal, Memoizable, Operations, Responseable, Stubbable
Instance Attribute Summary collapse
-
#base_url ⇒ String
Returns the provided base url.
- #block_connection ⇒ Boolean private
-
#hydra ⇒ Typhoeus::Hydra
private
Returns the hydra the request ran into if any.
-
#options ⇒ Hash
Returns options, which includes default parameters.
-
#original_options ⇒ Hash
private
Returns the original options provided.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
private
Returns wether other is equal to self.
-
#hash ⇒ Integer
private
Overrides Object#hash.
-
#initialize(base_url, options = {}) ⇒ Typhoeus::Request
constructor
Create a new request.
- #url ⇒ Object
Methods included from Actions
delete, get, head, patch, post, put
Methods included from Before
Methods included from Stubbable
Methods included from BlockConnection
Methods included from Memoizable
Methods included from Responseable
Methods included from Operations
Methods included from Marshal
Methods included from Callbacks
Methods included from Callbacks::Types
#on_complete, #on_failure, #on_success
Constructor Details
#initialize(base_url, options = {}) ⇒ Typhoeus::Request
See Ethon::Easy::Options for more options.
Create a new request.
107 108 109 110 111 112 113 |
# File 'lib/typhoeus/request.rb', line 107 def initialize(base_url, = {}) @base_url = base_url @original_options = @options = .dup set_defaults end |
Instance Attribute Details
#base_url ⇒ String
Returns the provided base url.
36 37 38 |
# File 'lib/typhoeus/request.rb', line 36 def base_url @base_url end |
#block_connection ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
60 61 62 |
# File 'lib/typhoeus/request.rb', line 60 def block_connection @block_connection end |
#hydra ⇒ Typhoeus::Hydra
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the hydra the request ran into if any.
48 49 50 |
# File 'lib/typhoeus/request.rb', line 48 def hydra @hydra end |
#options ⇒ Hash
Returns options, which includes default parameters.
41 42 43 |
# File 'lib/typhoeus/request.rb', line 41 def @options end |
#original_options ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the original options provided.
55 56 57 |
# File 'lib/typhoeus/request.rb', line 55 def @original_options end |
Instance Method Details
#eql?(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns wether other is equal to self.
129 130 131 132 133 |
# File 'lib/typhoeus/request.rb', line 129 def eql?(other) self.class == other.class && self.base_url == other.base_url && fuzzy_hash_eql?(self., other.) end |
#hash ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Overrides Object#hash.
140 141 142 |
# File 'lib/typhoeus/request.rb', line 140 def hash [ self.class, self.base_url, self. ].hash end |
#url ⇒ Object
115 116 117 |
# File 'lib/typhoeus/request.rb', line 115 def url base_url end |