Class: Http2::Cookie
- Inherits:
-
Object
- Object
- Http2::Cookie
- Defined in:
- lib/http2/cookie.rb
Instance Attribute Summary collapse
-
#expires_raw ⇒ Object
readonly
Returns the value of attribute expires_raw.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #expires ⇒ Object
-
#initialize(args) ⇒ Cookie
constructor
A new instance of Cookie.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Cookie
Returns a new instance of Cookie.
4 5 6 7 8 9 |
# File 'lib/http2/cookie.rb', line 4 def initialize(args) @name = args[:name] @value = args[:value] @path = args[:path] @expires_raw = args[:expires] end |
Instance Attribute Details
#expires_raw ⇒ Object (readonly)
Returns the value of attribute expires_raw.
2 3 4 |
# File 'lib/http2/cookie.rb', line 2 def expires_raw @expires_raw end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/http2/cookie.rb', line 2 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
2 3 4 |
# File 'lib/http2/cookie.rb', line 2 def path @path end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
2 3 4 |
# File 'lib/http2/cookie.rb', line 2 def value @value end |
Instance Method Details
#expires ⇒ Object
19 20 21 |
# File 'lib/http2/cookie.rb', line 19 def expires @expires ||= Time.parse(@expires_raw) if @expires_raw end |
#inspect ⇒ Object
11 12 13 |
# File 'lib/http2/cookie.rb', line 11 def inspect "#<Http2::Cookie name=#{@name} value=#{@value} path=#{@path}>" end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/http2/cookie.rb', line 15 def to_s inspect end |