module

Toshi::Api::ClassMethods

Instance methods

_create_client
Source
_create_pool
Source
_request(path : String, method = "GET", params = nil, headers = nil, body : String | JSON::Serializable | NamedTuple | Nil = nil)

Generic method for making a request with params and headers

Source
_request(uri : URI, method = "GET", headers = nil, body : String | Nil = nil)

Generic method for making a request with a URI and headers

Source
configure(_options : Options | Nil = nil, &)

Configure the API client

MyApi.configure do |opts|
  opts.host = "localhost"
  opts.port = 5000
  opts.prefix = "api/v0"
  opts.default_headers = {"User-Agent" => "Toshi-Ruby-Client"}
  opts.sleep_time = 0.1
end
Source
configure(_options : Options | Nil = nil)
Source
default_options
Source
logger
Source
make_request_uri(path : String, params : String | Nil = nil) : URI

URI helper function

Source
options
Source
pool
Source