Class: Ticuna::BaseProvider
- Inherits:
-
Object
- Object
- Ticuna::BaseProvider
- Defined in:
- lib/ticuna/base_provider.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(api_key:, base_url:) ⇒ BaseProvider
constructor
A new instance of BaseProvider.
Constructor Details
#initialize(api_key:, base_url:) ⇒ BaseProvider
Returns a new instance of BaseProvider.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ticuna/base_provider.rb', line 8 def initialize(api_key:, base_url:) @api_key = api_key @base_url = base_url @connection = Faraday.new( url: base_url, headers: { "Content-Type" => "application/json", "Authorization" => "Bearer #{api_key}" } ) do |f| f..timeout = nil f..open_timeout = nil end end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/ticuna/base_provider.rb', line 6 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
6 7 8 |
# File 'lib/ticuna/base_provider.rb', line 6 def base_url @base_url end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
6 7 8 |
# File 'lib/ticuna/base_provider.rb', line 6 def connection @connection end |