Class: Watir::Cookies
- Inherits:
-
Object
- Object
- Watir::Cookies
- Defined in:
- lib/watir-webdriver/cookies.rb
Instance Method Summary (collapse)
- - (Object) add(name, value, opts = {})
- - (Object) clear
- - (Object) delete(name)
-
- (Cookies) initialize(control)
constructor
A new instance of Cookies.
- - (Object) to_a
Constructor Details
- (Cookies) initialize(control)
A new instance of Cookies
3 4 5 |
# File 'lib/watir-webdriver/cookies.rb', line 3 def initialize(control) @control = control end |
Instance Method Details
- (Object) add(name, value, opts = {})
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/watir-webdriver/cookies.rb', line 13 def add(name, value, opts = {}) = { :name => name, :value => value, :secure => opts[:secure], :path => opts[:path], :expires => opts[:expires], } if opts[:domain] [:domain] = opts[:domain] end @control. end |
- (Object) clear
33 34 35 |
# File 'lib/watir-webdriver/cookies.rb', line 33 def clear @control. end |
- (Object) delete(name)
29 30 31 |
# File 'lib/watir-webdriver/cookies.rb', line 29 def delete(name) @control.(name) end |
- (Object) to_a
7 8 9 10 11 |
# File 'lib/watir-webdriver/cookies.rb', line 7 def to_a @control..each do |e| e[:expires] = to_time(e[:expires]) if e[:expires] end end |