Class: ReveAI::Client
- Inherits:
-
Object
- Object
- ReveAI::Client
- Defined in:
- lib/reve_ai/client.rb
Overview
HTTP client for the Reve image generation API.
Provides access to all Reve API endpoints through resource objects. Configure globally via configure or pass parameters directly to the constructor.
Instance Attribute Summary collapse
-
#configuration ⇒ Configuration
readonly
Configuration instance for this client.
Instance Method Summary collapse
-
#http_client ⇒ HTTP::Client
private
Returns the HTTP client for making API requests.
-
#images ⇒ Resources::Images
Returns the Images resource for image generation operations.
-
#initialize(api_key: nil, **options) ⇒ Client
constructor
Creates a new Reve API client.
Constructor Details
#initialize(api_key: nil, **options) ⇒ Client
Creates a new Reve API client.
45 46 47 48 |
# File 'lib/reve_ai/client.rb', line 45 def initialize(api_key: nil, **) @configuration = build_configuration(api_key, ) validate_configuration! end |
Instance Attribute Details
#configuration ⇒ Configuration (readonly)
Returns Configuration instance for this client.
28 29 30 |
# File 'lib/reve_ai/client.rb', line 28 def configuration @configuration end |
Instance Method Details
#http_client ⇒ HTTP::Client
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the HTTP client for making API requests.
78 79 80 |
# File 'lib/reve_ai/client.rb', line 78 def http_client @http_client ||= HTTP::Client.new(configuration) end |
#images ⇒ Resources::Images
Returns the Images resource for image generation operations.
70 71 72 |
# File 'lib/reve_ai/client.rb', line 70 def images @images ||= Resources::Images.new(self) end |