Class: Watir::Cookies
- Inherits:
-
Object
- Object
- Watir::Cookies
- Defined in:
- lib/watir-webdriver/cookies.rb
Instance Method Summary collapse
- #add(name, value, opts = {}) ⇒ Object
- #clear ⇒ Object
- #delete(name) ⇒ Object
-
#initialize(control) ⇒ Cookies
constructor
A new instance of Cookies.
- #to_a ⇒ Object
Constructor Details
#initialize(control) ⇒ Cookies
Returns 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
#add(name, value, opts = {}) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/watir-webdriver/cookies.rb', line 13 def add(name, value, opts = {}) @control. :name => name, :value => value, :secure => opts[:secure], :path => opts[:path], :expires => opts[:expires] end |
#clear ⇒ Object
25 26 27 |
# File 'lib/watir-webdriver/cookies.rb', line 25 def clear @control. end |
#delete(name) ⇒ Object
21 22 23 |
# File 'lib/watir-webdriver/cookies.rb', line 21 def delete(name) @control.(name) end |
#to_a ⇒ Object
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 |