Class: UnderOs::HTTP::Cookies

Inherits:
Object
  • Object
show all
Defined in:
lib/under_os/http/cookies.rb

Overview

A simple cookie jar thing

Instance Method Summary collapse

Constructor Details

#initialize(cookies, url) ⇒ Cookies

Returns a new instance of Cookies.



5
6
7
8
# File 'lib/under_os/http/cookies.rb', line 5

def initialize(cookies, url)
  @url  = url.is_a?(String) ? NSURL.URLWithString(url) : url
  @hash = cookies
end

Instance Method Details

#headersObject



10
11
12
# File 'lib/under_os/http/cookies.rb', line 10

def headers
  NSHTTPCookie.requestHeaderFieldsWithCookies(ios_cookies)
end

#to_sObject



14
15
16
# File 'lib/under_os/http/cookies.rb', line 14

def to_s
  headers["Cookie"]
end