Class: HTTP::CookieJar::CookiestxtSaver
- Inherits:
-
AbstractSaver
- Object
- AbstractSaver
- HTTP::CookieJar::CookiestxtSaver
- Defined in:
- lib/http/cookie_jar/cookiestxt_saver.rb
Overview
CookiestxtSaver saves and loads cookies in the cookies.txt format.
Instance Method Summary collapse
Methods inherited from AbstractSaver
class_to_symbol, implementation, inherited, #initialize
Constructor Details
This class inherits a constructor from HTTP::CookieJar::AbstractSaver
Instance Method Details
#load(io, jar) ⇒ Object
32 33 34 35 36 |
# File 'lib/http/cookie_jar/cookiestxt_saver.rb', line 32 def load(io, jar) io.each_line { |line| = parse_record(line) and jar.add() } end |
#save(io, jar) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/http/cookie_jar/cookiestxt_saver.rb', line 24 def save(io, jar) io.puts @header if @header jar.each { || next if !@session && .session? io.print () } end |