Class: Sydecar::BaseConnection
- Inherits:
-
Object
- Object
- Sydecar::BaseConnection
- Defined in:
- lib/sydecar/base_connection.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.base_url ⇒ Object
Returns the value of attribute base_url.
-
.env ⇒ Object
Returns the value of attribute env.
-
.token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Class Attribute Details
.base_url ⇒ Object
Returns the value of attribute base_url.
4 5 6 |
# File 'lib/sydecar/base_connection.rb', line 4 def base_url @base_url end |
.env ⇒ Object
Returns the value of attribute env.
4 5 6 |
# File 'lib/sydecar/base_connection.rb', line 4 def env @env end |
.token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/sydecar/base_connection.rb', line 4 def token @token end |
Class Method Details
.common_headers ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/sydecar/base_connection.rb', line 6 def common_headers { 'Authorization' => "Bearer #{token}", 'User-Agent' => 'Faraday', 'Connection' => 'keep-alive', 'Accept' => 'application/json', } end |
.instance ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/sydecar/base_connection.rb', line 15 def instance unless token raise TokenNotSetError end unless base_url raise BaseUrlNotSetError end end |