Class: Gitter::API::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/gitter/api/config.rb

Overview

A singleton class for holding on to default values for the Gitter::API::Client for the given session.

When making changes here, it will affect every Gitter::API::Client that is configured going forward, unless the values are changed on client instanciation via the config hash.

Tunable attributes

  • api_prefix

  • api_url

  • ssl_verify

Constant Summary collapse

DEFAULT_API_PREFIX =

API prefix for production api.gitter.im (“/v1”)

"/v1"
DEFAULT_API_URL =

Default API URL (“api.gitter.im”)

"https://api.gitter.im"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_prefixObject

:doc: The prefix for the API endpoints (default: /v1)

In development using a local gitter instance, it should be /api/v1, but in production it is just /v1



29
30
31
# File 'lib/gitter/api/config.rb', line 29

def api_prefix
  @api_prefix
end

.api_urlObject

:doc: Endpoint URL for the Gitter API (default: “api.gitter.im”)

For local instances of gitter-webapp, the URL can then be set to http://localhost:5000.



32
33
34
# File 'lib/gitter/api/config.rb', line 32

def api_url
  @api_url
end

.ssl_verifyObject

:doc: If the base endpoint should verify SSL cert (default: true)



38
39
40
# File 'lib/gitter/api/config.rb', line 38

def ssl_verify
  @ssl_verify
end

Class Method Details

.api_uriObject

:doc: URI object cache of the api_url



72
73
74
# File 'lib/gitter/api/config.rb', line 72

def api_uri
  @api_uri ||= URI(api_url)
end