Module: ShowMeTheCookies
- Defined in:
- lib/show_me_the_cookies.rb,
lib/show_me_the_cookies/version.rb
Defined Under Namespace
Classes: Poltergeist, RackTest, Selenium, UnknownDriverError
Constant Summary collapse
- VERSION =
"2.2.0"
Class Attribute Summary collapse
-
.adapters ⇒ Object
readonly
Returns the value of attribute adapters.
Class Method Summary collapse
-
.register_adapter(driver, adapter) ⇒ Object
Register your own capybara-driver cookie adapter.
Instance Method Summary collapse
- #create_cookie(name, value) ⇒ Object
-
#delete_cookie(cookie_name) ⇒ Object
deletes the named cookie.
-
#expire_cookies ⇒ Object
removes session cookies and expired persistent cookies.
-
#get_me_the_cookie(cookie_name) ⇒ Object
returns a hash of the cookie form: :domain, :value, :expires, :path.
-
#get_me_the_cookies ⇒ Object
returns an array of cookie hashes form: [:domain, :value, :expires, :path].
-
#show_me_the_cookie(cookie_name) ⇒ Object
puts a string summary of the cookie.
-
#show_me_the_cookies ⇒ Object
puts a string summary of all cookies.
Class Attribute Details
.adapters ⇒ Object (readonly)
Returns the value of attribute adapters.
8 9 10 |
# File 'lib/show_me_the_cookies.rb', line 8 def adapters @adapters end |
Class Method Details
.register_adapter(driver, adapter) ⇒ Object
Register your own capybara-driver cookie adapter. Use the same name as the one Capybara does to identify that driver. Implement the interface of spec/shared_examples_for_api, as seen in lib/show_me_the_cookies/drivers
13 14 15 |
# File 'lib/show_me_the_cookies.rb', line 13 def register_adapter(driver, adapter) adapters[driver] = adapter end |
Instance Method Details
#create_cookie(name, value) ⇒ Object
55 56 57 |
# File 'lib/show_me_the_cookies.rb', line 55 def (name, value) current_driver_adapter.(name, value) end |
#delete_cookie(cookie_name) ⇒ Object
deletes the named cookie
46 47 48 |
# File 'lib/show_me_the_cookies.rb', line 46 def () current_driver_adapter.() end |
#expire_cookies ⇒ Object
removes session cookies and expired persistent cookies
51 52 53 |
# File 'lib/show_me_the_cookies.rb', line 51 def current_driver_adapter. end |
#get_me_the_cookie(cookie_name) ⇒ Object
returns a hash of the cookie form: :domain, :value, :expires, :path
30 31 32 |
# File 'lib/show_me_the_cookies.rb', line 30 def () current_driver_adapter.() end |
#get_me_the_cookies ⇒ Object
returns an array of cookie hashes form: [:domain, :value, :expires, :path]
41 42 43 |
# File 'lib/show_me_the_cookies.rb', line 41 def current_driver_adapter. end |
#show_me_the_cookie(cookie_name) ⇒ Object
puts a string summary of the cookie
24 25 26 |
# File 'lib/show_me_the_cookies.rb', line 24 def () puts "#{}: #{().inspect}" end |
#show_me_the_cookies ⇒ Object
puts a string summary of all cookies
35 36 37 |
# File 'lib/show_me_the_cookies.rb', line 35 def puts "Cookies: #{.inspect}" end |