Class: ElevenLabs::Client

Inherits:
Object
  • Object
show all
Includes:
Configurable, Connection
Defined in:
lib/eleven_labs/client.rb

Constant Summary

Constants included from Connection

ElevenLabs::Connection::CONVENIENCE_HEADERS, ElevenLabs::Connection::DEFAULT_MEDIA_TYPE, ElevenLabs::Connection::USER_AGENT

Instance Attribute Summary

Attributes included from Configurable

#api_endpoint, #api_key

Instance Method Summary collapse

Methods included from Connection

#agent, #delete, #get, #head, #last_response, #patch, #post, #put

Methods included from Configurable

#configure, keys

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
17
# File 'lib/eleven_labs/client.rb', line 11

def initialize(options = {})
  # Use options passed in, but fall back to module defaults
  ElevenLabs::Configurable.keys.each do |key|
    value = options.key?(key) ? options[key] : ElevenLabs.instance_variable_get(:"@#{key}")
    instance_variable_set(:"@#{key}", value)
  end
end