Class: Ey::Core::TokenAuthentication
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- Ey::Core::TokenAuthentication
- Defined in:
- lib/ey-core/token_authentication.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, token) ⇒ TokenAuthentication
constructor
A new instance of TokenAuthentication.
Constructor Details
#initialize(app, token) ⇒ TokenAuthentication
Returns a new instance of TokenAuthentication.
4 5 6 7 |
# File 'lib/ey-core/token_authentication.rb', line 4 def initialize(app, token) super(app) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
2 3 4 |
# File 'lib/ey-core/token_authentication.rb', line 2 def token @token end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 |
# File 'lib/ey-core/token_authentication.rb', line 9 def call(env) env[:request_headers]["X-EY-TOKEN"] = token super end |