Class: Castle::ClientId::Extract
- Inherits:
-
Object
- Object
- Castle::ClientId::Extract
- Defined in:
- lib/castle/client_id/extract.rb
Overview
used for extraction of cookies and headers from the request
Instance Method Summary collapse
-
#call ⇒ String
extracts client id.
-
#initialize(headers, cookies) ⇒ Extract
constructor
A new instance of Extract.
Constructor Details
#initialize(headers, cookies) ⇒ Extract
Returns a new instance of Extract.
9 10 11 12 |
# File 'lib/castle/client_id/extract.rb', line 9 def initialize(headers, ) @headers = headers @cookies = || {} end |
Instance Method Details
#call ⇒ String
extracts client id
16 17 18 |
# File 'lib/castle/client_id/extract.rb', line 16 def call @headers['X-Castle-Client-Id'] || @cookies['__cid'] || '' end |