Module: Mechanize::CookieJarIMethods

Includes:
CookieDeprecated
Defined in:
lib/mechanize/cookie_jar.rb

Instance Method Summary collapse

Instance Method Details

#add(arg1, arg2 = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mechanize/cookie_jar.rb', line 12

def add(arg1, arg2 = nil)
  if arg2
    __deprecated__ 'add and origin='
    super arg2.dup.tap { |ncookie|
      begin
        ncookie.origin = arg1
      rescue
        return nil
      end
    }
  else
    super arg1
  end
end

#add!(cookie) ⇒ Object

See HTTP::CookieJar#add.



28
29
30
31
32
33
# File 'lib/mechanize/cookie_jar.rb', line 28

def add!(cookie)
  __deprecated__ :add
  cookie.domain.nil? and raise NoMethodError, 'raised for compatibility'
  @store.add(cookie)
  self
end

#clear!Object

See HTTP::CookieJar#clear.



42
43
44
45
# File 'lib/mechanize/cookie_jar.rb', line 42

def clear!
  __deprecated__ :clear
  clear
end

#dump_cookiestxt(io) ⇒ Object

See HTTP::CookieJar#save.



60
61
62
63
# File 'lib/mechanize/cookie_jar.rb', line 60

def dump_cookiestxt(io)
  __deprecated__ :save
  save(io, :cookiestxt)
end

#jarObject

See HTTP::CookieJar#store.



48
49
50
51
# File 'lib/mechanize/cookie_jar.rb', line 48

def jar
  __deprecated__ :store
  @store.instance_variable_get(:@jar)
end

#load_cookiestxt(io) ⇒ Object

See HTTP::CookieJar#load.



54
55
56
57
# File 'lib/mechanize/cookie_jar.rb', line 54

def load_cookiestxt(io)
  __deprecated__ :load
  load(io, :cookiestxt)
end

#save_as(filename, *options) ⇒ Object

See HTTP::CookieJar#save.



36
37
38
39
# File 'lib/mechanize/cookie_jar.rb', line 36

def save_as(filename, *options)
  __deprecated__ :save
  save(filename, *options)
end