Class: Buble::Client
- Inherits:
-
Object
- Object
- Buble::Client
- Defined in:
- lib/buble/client.rb
Instance Attribute Summary collapse
-
#apps ⇒ Object
readonly
Returns the value of attribute apps.
-
#chat ⇒ Object
readonly
Returns the value of attribute chat.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#generations ⇒ Object
readonly
Returns the value of attribute generations.
-
#media_models ⇒ Object
readonly
Returns the value of attribute media_models.
Instance Method Summary collapse
-
#initialize(api_key: nil, base_url: nil, timeout: HTTP::DEFAULT_TIMEOUT, headers: {}, transport: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key: nil, base_url: nil, timeout: HTTP::DEFAULT_TIMEOUT, headers: {}, transport: nil) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/buble/client.rb', line 14 def initialize(api_key: nil, base_url: nil, timeout: HTTP::DEFAULT_TIMEOUT, headers: {}, transport: nil) resolved_api_key = first_present(api_key, ENV.fetch('BUBLE_API_KEY', nil)) resolved_base_url = first_present(base_url, ENV.fetch('BUBLE_BASE_URL', nil), HTTP::DEFAULT_BASE_URL) @transport = transport || HTTP.new( api_key: resolved_api_key, base_url: resolved_base_url, timeout: timeout, headers: headers ) @media_models = MediaModelsResource.new(@transport) @files = FilesResource.new(@transport) @generations = GenerationsResource.new(@transport) @apps = AppsResource.new(@transport) @chat = ChatResource.new(@transport) end |
Instance Attribute Details
#apps ⇒ Object (readonly)
Returns the value of attribute apps.
12 13 14 |
# File 'lib/buble/client.rb', line 12 def apps @apps end |
#chat ⇒ Object (readonly)
Returns the value of attribute chat.
12 13 14 |
# File 'lib/buble/client.rb', line 12 def chat @chat end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
12 13 14 |
# File 'lib/buble/client.rb', line 12 def files @files end |
#generations ⇒ Object (readonly)
Returns the value of attribute generations.
12 13 14 |
# File 'lib/buble/client.rb', line 12 def generations @generations end |
#media_models ⇒ Object (readonly)
Returns the value of attribute media_models.
12 13 14 |
# File 'lib/buble/client.rb', line 12 def media_models @media_models end |