Class: LibWebSocket::Cookie::Response
- Inherits:
-
LibWebSocket::Cookie
- Object
- LibWebSocket::Cookie
- LibWebSocket::Cookie::Response
- Defined in:
- lib/libwebsocket/cookie/response.rb
Overview
Construct or parse a WebSocket response cookie.
Constant Summary
Constants inherited from LibWebSocket::Cookie
NAME, QUOTED_STRING, TOKEN, VALUE
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#comment_url ⇒ Object
Returns the value of attribute comment_url.
-
#discard ⇒ Object
Returns the value of attribute discard.
-
#max_age ⇒ Object
Returns the value of attribute max_age.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#portlist ⇒ Object
Returns the value of attribute portlist.
-
#secure ⇒ Object
Returns the value of attribute secure.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from LibWebSocket::Cookie
Instance Method Summary collapse
-
#to_s ⇒ Object
Construct a WebSocket response cookie.
Methods inherited from LibWebSocket::Cookie
Constructor Details
This class inherits a constructor from LibWebSocket::Cookie
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def comment @comment end |
#comment_url ⇒ Object
Returns the value of attribute comment_url.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def comment_url @comment_url end |
#discard ⇒ Object
Returns the value of attribute discard.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def discard @discard end |
#max_age ⇒ Object
Returns the value of attribute max_age.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def max_age @max_age end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def path @path end |
#portlist ⇒ Object
Returns the value of attribute portlist.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def portlist @portlist end |
#secure ⇒ Object
Returns the value of attribute secure.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def secure @secure end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/libwebsocket/cookie/response.rb', line 6 def value @value end |
Instance Method Details
#to_s ⇒ Object
Construct a WebSocket response cookie.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/libwebsocket/cookie/response.rb', line 17 def to_s pairs = [] pairs.push([self.name, self.value]) pairs.push ['Comment', self.comment] if self.comment pairs.push ['CommentURL', self.comment_url] if self.comment_url pairs.push ['Discard'] if self.discard pairs.push ['Max-Age', self.max_age] if self.max_age pairs.push ['Path', self.path] if self.path if self.portlist self.portlist = Array(self.portlist) list = self.portlist.join(' ') pairs.push ['Port', "\"#{list}\""] end pairs.push ['Secure'] if self.secure pairs.push ['Version', '1'] self.pairs = pairs super end |