Class: EventMachine::AblyHttpRequest::HttpClient::CookieJar
- Inherits:
-
Object
- Object
- EventMachine::AblyHttpRequest::HttpClient::CookieJar
- Defined in:
- lib/em-http/client.rb
Instance Method Summary collapse
- #get(uri) ⇒ Object
-
#initialize ⇒ CookieJar
constructor
A new instance of CookieJar.
- #set(string, uri) ⇒ Object
Constructor Details
#initialize ⇒ CookieJar
Returns a new instance of CookieJar.
328 329 330 |
# File 'lib/em-http/client.rb', line 328 def initialize @jar = ::CookieJar::Jar.new end |
Instance Method Details
#get(uri) ⇒ Object
336 337 338 339 |
# File 'lib/em-http/client.rb', line 336 def get uri uri = URI.parse(uri) rescue nil uri ? @jar.(uri) : [] end |
#set(string, uri) ⇒ Object
332 333 334 |
# File 'lib/em-http/client.rb', line 332 def set string, uri @jar.(uri, string) rescue nil # drop invalid cookies end |