module HTTPX::Plugins::Cookies::InstanceMethods

  1. lib/httpx/plugins/cookies.rb

Methods

Public Class

  1. new

Public Instance

  1. wrap

Public Class methods

new (options = {}, &blk)
[show source]
   # File lib/httpx/plugins/cookies.rb
81 def initialize(options = {}, &blk)
82   super({ cookies: Store.new }.merge(options), &blk)
83 end

Public Instance methods

wrap ()
[show source]
   # File lib/httpx/plugins/cookies.rb
85 def wrap
86   return super unless block_given?
87 
88   super do |session|
89     old_cookies_store = @options.cookies.dup
90     begin
91       yield session
92     ensure
93       @options = @options.with(cookies: old_cookies_store)
94     end
95   end
96 end