Class: Foobara::CommandConnectors::Http::Cookie
- Inherits:
-
Object
- Object
- Foobara::CommandConnectors::Http::Cookie
- Defined in:
- foobara-http-command-connector-0.0.23/src/http/cookie.rb
Constant Summary collapse
- ALLOWED_OPTIONS =
%i[path httponly secure same_site domain expires max_age].freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value, **opts) ⇒ Cookie
constructor
A new instance of Cookie.
Constructor Details
#initialize(name, value, **opts) ⇒ Cookie
Returns a new instance of Cookie.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'foobara-http-command-connector-0.0.23/src/http/cookie.rb', line 9 def initialize(name, value, **opts) = opts.keys - ALLOWED_OPTIONS unless .empty? # :nocov: raise ArgumentError, "Invalid options #{.inspect} expected only #{ALLOWED_OPTIONS.inspect}" # :nocov: end self.name = name self.value = value self.opts = opts.transform_keys(&:to_sym) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'foobara-http-command-connector-0.0.23/src/http/cookie.rb', line 5 def name @name end |
#opts ⇒ Object
Returns the value of attribute opts.
5 6 7 |
# File 'foobara-http-command-connector-0.0.23/src/http/cookie.rb', line 5 def opts @opts end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'foobara-http-command-connector-0.0.23/src/http/cookie.rb', line 5 def value @value end |