Method: HTTPX::Plugins::Cookies::InstanceMethods#wrap

Defined in:
lib/httpx/plugins/cookies.rb

#wrapObject



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/httpx/plugins/cookies.rb', line 77

def wrap
  return super unless block_given?

  super do |session|
    old_cookies_store = @options.cookies.dup
    begin
      yield session
    ensure
      @options = @options.with_cookies(old_cookies_store)
    end
  end
end