Module: TwelvedataRuby

Defined in:
lib/twelvedata_ruby.rb,
lib/twelvedata_ruby/error.rb,
lib/twelvedata_ruby/utils.rb,
lib/twelvedata_ruby/client.rb,
lib/twelvedata_ruby/request.rb,
lib/twelvedata_ruby/version.rb,
lib/twelvedata_ruby/endpoint.rb,
lib/twelvedata_ruby/response.rb

Overview

Handles API responses from Twelve Data

Defined Under Namespace

Modules: Utils Classes: BadRequestResponseError, Client, ConfigurationError, Endpoint, EndpointError, EndpointNameError, EndpointParametersKeysError, EndpointRequiredParametersError, Error, ForbiddenResponseError, InternalServerResponseError, NetworkError, NotFoundResponseError, PageNotFoundResponseError, ParameterTooLongResponseError, Request, Response, ResponseError, TooManyRequestsResponseError, UnauthorizedResponseError

Constant Summary collapse

VERSION =

Current version of the TwelvedataRuby gem

"0.4.0"

Class Method Summary collapse

Class Method Details

.client(**options) ⇒ Client

Creates and configures a client instance

Examples:

Basic client creation

client = TwelvedataRuby.client(apikey: "your-key")

With custom timeout

client = TwelvedataRuby.client(
  apikey: "your-key",
  connect_timeout: 5000
)

Parameters:

  • options (Hash)

    Configuration options

Options Hash (**options):

  • :apikey (String)

    The Twelve Data API key

  • :connect_timeout (Integer)

    Connection timeout in milliseconds

  • :apikey_env_var_name (String)

    Environment variable name for API key

Returns:

  • (Client)

    Configured client instance



41
42
43
44
45
# File 'lib/twelvedata_ruby.rb', line 41

def client(**options)
  client_instance = Client.instance
  client_instance.configure(**options) if options.any?
  client_instance
end

.versionString

Returns the current version

Returns:

  • (String)

    Version string



50
51
52
# File 'lib/twelvedata_ruby.rb', line 50

def version
  VERSION
end