Module: Dock::Api

Defined in:
lib/dock/api.rb,
lib/dock/api/version.rb,
lib/dock/api/configuration.rb,
lib/dock/api/endpoints/base.rb,
lib/dock/api/endpoints/dids.rb,
lib/dock/api/endpoints/jobs.rb,
lib/dock/api/endpoints/verify.rb,
lib/dock/api/endpoints/anchors.rb,
lib/dock/api/endpoints/schemas.rb,
lib/dock/api/endpoints/profiles.rb,
lib/dock/api/endpoints/registries.rb,
lib/dock/api/endpoints/credentials.rb,
lib/dock/api/endpoints/presentations.rb,
lib/dock/api/endpoints/revocation_status.rb

Defined Under Namespace

Classes: Anchors, BadRequest, Base, Configuration, Credentials, Dids, Error, Jobs, MethodNotAllowed, NotFound, Presentations, Profiles, Registries, RequestError, RevocationStatus, Schemas, Unauthorized, Verify

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.configObject



27
28
29
# File 'lib/dock/api.rb', line 27

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



31
32
33
# File 'lib/dock/api.rb', line 31

def configure
  yield(config)
end

.connectionObject



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/dock/api.rb', line 35

def connection
  @conn ||= Faraday.new(url: config.host) do |f|
    f.adapter :httpx
    f.request :json
    f.request :url_encoded
    f.request :retry, max: config.request_retry_count
    f.request :authorization, 'Bearer', config.auth_token
    f.response :json
    f.response :logger if config.log_requests
  end
end