Class: Capybara::Apparition::Cookie
- Inherits:
-
Object
- Object
- Capybara::Apparition::Cookie
- Defined in:
- lib/capybara/apparition/cookie.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #domain ⇒ Object
- #expires ⇒ Object
- #http_only? ⇒ Boolean (also: #httponly?)
-
#httpOnly? ⇒ Boolean
rubocop:disable Naming/MethodName.
-
#initialize(attributes) ⇒ Cookie
constructor
A new instance of Cookie.
- #name ⇒ Object
- #path ⇒ Object
- #same_site ⇒ Object
- #samesite ⇒ Object
- #secure? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Cookie
Returns a new instance of Cookie.
5 6 7 |
# File 'lib/capybara/apparition/cookie.rb', line 5 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#==(other) ⇒ Object
51 52 53 54 55 |
# File 'lib/capybara/apparition/cookie.rb', line 51 def ==(other) return super unless other.is_a? String value == other end |
#domain ⇒ Object
17 18 19 |
# File 'lib/capybara/apparition/cookie.rb', line 17 def domain @attributes['domain'] end |
#expires ⇒ Object
47 48 49 |
# File 'lib/capybara/apparition/cookie.rb', line 47 def expires Time.at @attributes['expires'] unless [nil, 0, -1].include? @attributes['expires'] end |
#http_only? ⇒ Boolean Also known as: httponly?
29 30 31 |
# File 'lib/capybara/apparition/cookie.rb', line 29 def http_only? @attributes['httpOnly'] end |
#httpOnly? ⇒ Boolean
rubocop:disable Naming/MethodName
34 35 36 37 |
# File 'lib/capybara/apparition/cookie.rb', line 34 def httpOnly? # rubocop:disable Naming/MethodName warn 'httpOnly? is deprecated, please use http_only? instead' http_only? end |
#name ⇒ Object
9 10 11 |
# File 'lib/capybara/apparition/cookie.rb', line 9 def name @attributes['name'] end |
#path ⇒ Object
21 22 23 |
# File 'lib/capybara/apparition/cookie.rb', line 21 def path @attributes['path'] end |
#same_site ⇒ Object
39 40 41 |
# File 'lib/capybara/apparition/cookie.rb', line 39 def same_site @attributes['sameSite'] end |
#samesite ⇒ Object
43 44 45 |
# File 'lib/capybara/apparition/cookie.rb', line 43 def samesite same_site end |
#secure? ⇒ Boolean
25 26 27 |
# File 'lib/capybara/apparition/cookie.rb', line 25 def secure? @attributes['secure'] end |
#value ⇒ Object
13 14 15 |
# File 'lib/capybara/apparition/cookie.rb', line 13 def value @attributes['value'] end |