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 more...
Overview
This class represents a request.
Defined Under Namespace
Modules: Actions, Before, BlockConnection, Callbacks, Marshal, Memoizable, Operations, Responseable, Stubbable
Instance Attribute Summary collapse
- #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.
-
#url ⇒ String
Returns the provided url.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
private
Returns wether other is equal to self.
-
#hash ⇒ Integer
private
Overrides Object#hash.
-
#initialize(url, options = {}) ⇒ Typhoeus::Request
constructor
Create a new request.
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
permalink #initialize(url, options = {}) ⇒ Typhoeus::Request
See Ethon::Easy#initialize for more options.
Create a new request.
107 108 109 110 111 112 113 |
# File 'lib/typhoeus/request.rb', line 107 def initialize(url, = {}) @url = url @original_options = @options = .dup set_defaults end |
Instance Attribute Details
permalink #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 |
permalink #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 |
permalink #options ⇒ Hash
Returns options, which includes default parameters.
41 42 43 |
# File 'lib/typhoeus/request.rb', line 41 def @options end |
permalink #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 |
permalink #url ⇒ String
Returns the provided url.
36 37 38 |
# File 'lib/typhoeus/request.rb', line 36 def url @url end |
Instance Method Details
permalink #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.
125 126 127 128 129 |
# File 'lib/typhoeus/request.rb', line 125 def eql?(other) self.class == other.class && self.url == other.url && fuzzy_hash_eql?(self., other.) end |
permalink #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.
136 137 138 |
# File 'lib/typhoeus/request.rb', line 136 def hash [ self.class, self.url, self. ].hash end |