Class: Dino::Apis::Base
- Inherits:
-
Object
- Object
- Dino::Apis::Base
- Defined in:
- lib/dino/apis/base.rb
Constant Summary collapse
- BASE_URL =
ENV['DINO_API_BASE_URL'] || 'https://api.dino.com.br/v2/'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #fetch_data(path) ⇒ Object
-
#initialize(client: Dino::Clients::Cache.new, options: {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/dino/apis/base.rb', line 6 def client @client end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/dino/apis/base.rb', line 6 def @options end |
Instance Method Details
#fetch_data(path) ⇒ Object
12 13 14 |
# File 'lib/dino/apis/base.rb', line 12 def fetch_data(path) client.fetch_data(BASE_URL + path, ) end |