Module: ReveAI
- Defined in:
- lib/reve_ai.rb,
lib/reve_ai/client.rb,
lib/reve_ai/errors.rb,
lib/reve_ai/version.rb,
lib/reve_ai/response.rb,
lib/reve_ai/http/client.rb,
lib/reve_ai/configuration.rb,
lib/reve_ai/resources/base.rb,
lib/reve_ai/resources/images.rb
Overview
Ruby client for the Reve image generation API.
ReveAI provides a lightweight Faraday-based wrapper for the Reve API, supporting image creation, editing, and remixing operations.
Defined Under Namespace
Modules: HTTP, Resources Classes: APIError, BadRequestError, Client, Configuration, ConfigurationError, ConnectionError, Error, ForbiddenError, ImageResponse, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, Response, ServerError, TimeoutError, UnauthorizedError, UnprocessableEntityError, ValidationError
Constant Summary collapse
- VERSION =
Returns Current gem version.
"0.1.1"
Class Attribute Summary collapse
-
.configuration ⇒ Configuration?
Global configuration instance.
Class Method Summary collapse
-
.client(api_key: nil, **options) ⇒ Client
Creates a new API client with optional per-instance configuration.
-
.configure {|config| ... } ⇒ Configuration
Configures global settings for all ReveAI clients.
-
.reset_configuration! ⇒ nil
Resets the global configuration to nil.
Class Attribute Details
.configuration ⇒ Configuration?
Returns Global configuration instance.
36 37 38 |
# File 'lib/reve_ai.rb', line 36 def configuration @configuration end |
Class Method Details
.client(api_key: nil, **options) ⇒ Client
Creates a new API client with optional per-instance configuration.
This is a convenience method equivalent to calling Client.new.
86 87 88 |
# File 'lib/reve_ai.rb', line 86 def client(api_key: nil, **) Client.new(api_key: api_key, **) end |
.configure {|config| ... } ⇒ Configuration
Configures global settings for all ReveAI clients.
51 52 53 54 55 |
# File 'lib/reve_ai.rb', line 51 def configure self.configuration ||= Configuration.new yield(configuration) if block_given? configuration end |
.reset_configuration! ⇒ nil
Resets the global configuration to nil.
Useful for testing or reinitializing the client.
65 66 67 |
# File 'lib/reve_ai.rb', line 65 def reset_configuration! self.configuration = nil end |