Class: ModelsLab::Client
- Inherits:
-
Object
- Object
- ModelsLab::Client
- Includes:
- HTTP
- Defined in:
- lib/modelslab/client.rb
Constant Summary collapse
- CONFIG_KEYS =
%i[api_key uri_base request_timeout extra_headers].freeze
Instance Method Summary collapse
- #enterprise ⇒ Object
- #images ⇒ Object
-
#initialize(config = {}, &faraday_middleware) ⇒ Client
constructor
A new instance of Client.
Methods included from HTTP
Constructor Details
#initialize(config = {}, &faraday_middleware) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 |
# File 'lib/modelslab/client.rb', line 10 def initialize(config = {}, &faraday_middleware) CONFIG_KEYS.each do |key| instance_variable_set( "@#{key}", config[key].nil? ? ModelsLab.configuration.send(key) : config[key] ) end @faraday_middleware = faraday_middleware end |
Instance Method Details
#enterprise ⇒ Object
24 25 26 |
# File 'lib/modelslab/client.rb', line 24 def enterprise @enterprise ||= Enterprise.new(client: self) end |