Class: Rxer::Api::Client
- Inherits:
-
Object
- Object
- Rxer::Api::Client
- Defined in:
- lib/rxer/api/client.rb
Overview
HTTP-client based on Faraday and Excon adapter
Instance Attribute Summary collapse
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#conn ⇒ Object
Returns the value of attribute conn.
Instance Method Summary collapse
-
#initialize(url:, version: "v1") ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(url:, version: "v1") ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 |
# File 'lib/rxer/api/client.rb', line 10 def initialize(url:, version: "v1") @api_version = version @conn = Faraday.new(url: url) do |f| f.adapter :excon, persistent: true f.request :json f.response :json end include_api_version_methods end |
Instance Attribute Details
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
7 8 9 |
# File 'lib/rxer/api/client.rb', line 7 def api_version @api_version end |
#conn ⇒ Object
Returns the value of attribute conn.
8 9 10 |
# File 'lib/rxer/api/client.rb', line 8 def conn @conn end |