Class: LibWebSocket::Cookie::Request
- Inherits:
-
LibWebSocket::Cookie
- Object
- LibWebSocket::Cookie
- LibWebSocket::Cookie::Request
- Defined in:
- lib/libwebsocket/cookie/request.rb
Overview
Construct or parse a WebSocket request cookie.
Constant Summary
Constants inherited from LibWebSocket::Cookie
NAME, QUOTED_STRING, TOKEN, VALUE
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#value ⇒ Object
Returns the value of attribute value.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from LibWebSocket::Cookie
Instance Method Summary collapse
-
#parse(string) ⇒ Object
Parse a WebSocket request cookie.
Methods inherited from LibWebSocket::Cookie
Constructor Details
This class inherits a constructor from LibWebSocket::Cookie
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
6 7 8 |
# File 'lib/libwebsocket/cookie/request.rb', line 6 def domain @domain end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/libwebsocket/cookie/request.rb', line 6 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/libwebsocket/cookie/request.rb', line 6 def path @path end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/libwebsocket/cookie/request.rb', line 6 def value @value end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/libwebsocket/cookie/request.rb', line 6 def version @version end |
Instance Method Details
#parse(string) ⇒ Object
Parse a WebSocket request cookie.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/libwebsocket/cookie/request.rb', line 12 def parse(string) result = super return unless result = [] pair = self.pairs.shift version = pair[1] = nil self.pairs.each do |pair| next unless pair[0] if pair[0].match(/^[^\$]/) .push() if = self.(:name => pair[0], :value => pair[1], :version => version) elsif pair[0] == '$Path' .path = pair[1] elsif pair[0] == '$Domain' .domain = pair[1] end end .push() if return end |