Module: HTTPX::Plugins::Cookies::InstanceMethods
- Extended by:
- Forwardable
- Defined in:
- lib/httpx/plugins/cookies.rb
Instance Method Summary collapse
- #build_request ⇒ Object
- #initialize(options = {}, &blk) ⇒ Object
-
#make_jar(*args) ⇒ Object
factory method to return a Jar to the user, which can then manipulate externally to the session.
- #wrap ⇒ Object
Instance Method Details
#build_request ⇒ Object
41 42 43 44 45 |
# File 'lib/httpx/plugins/cookies.rb', line 41 def build_request(*) request = super request.headers.(request..[request.uri]) request end |
#initialize(options = {}, &blk) ⇒ Object
24 25 26 |
# File 'lib/httpx/plugins/cookies.rb', line 24 def initialize( = {}, &blk) super({ cookies: Jar.new }.merge(), &blk) end |
#make_jar(*args) ⇒ Object
factory method to return a Jar to the user, which can then manipulate externally to the session.
49 50 51 |
# File 'lib/httpx/plugins/cookies.rb', line 49 def make_jar(*args) Jar.new(*args) end |
#wrap ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/httpx/plugins/cookies.rb', line 28 def wrap return super unless block_given? super do |session| = ..dup begin yield session ensure = .merge(cookies: ) end end end |