Module: Ferrum::Cookies::Collection
- Includes:
- Enumerable
- Included in:
- Ferrum::Cookies, Page::Cookies
- Defined in:
- lib/ferrum/cookies/collection.rb,
sig/ferrum/cookies/collection.rbs
Overview
Reading cookies by name, shared by Ferrum::Cookies and Page::Cookies, both
of which define each.
Instance Method Summary collapse
-
#[](name, domain: nil, path: nil) ⇒ Cookie?
Returns the first cookie with the given name, narrowed down by domain and path when the name is used by more than one cookie.
Instance Method Details
#[](name, domain: nil, path: nil) ⇒ Cookie?
Returns the first cookie with the given name, narrowed down by domain and path when the name is used by more than one cookie.
40 41 42 43 44 |
# File 'lib/ferrum/cookies/collection.rb', line 40 def [](name, domain: nil, path: nil) find do || .name == name && (domain.nil? || .domain == domain) && (path.nil? || .path == path) end end |