Class: HTTP::Session::Cookies

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
MonitorMixin
Defined in:
lib/http/session/cookies.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Cookies

Returns a new instance of Cookies.

Parameters:



12
13
14
15
# File 'lib/http/session/cookies.rb', line 12

def initialize(options)
  super()
  @options = options
end

Instance Method Details

#enabled?Boolean

True when it is enabled.

Returns:

  • (Boolean)


9
# File 'lib/http/session/cookies.rb', line 9

def_delegator :@options, :enabled?

#read(uri) ⇒ nil, Hash

Read cookies.

Returns:

  • (nil, Hash)


20
21
22
23
24
# File 'lib/http/session/cookies.rb', line 20

def read(uri)
  synchronize do
    read_cookies(uri)
  end
end

#write(res) ⇒ void

This method returns an undefined value.

Write cookies.

Parameters:



30
31
32
33
34
# File 'lib/http/session/cookies.rb', line 30

def write(res)
  synchronize do
    write_cookies(res)
  end
end