Class: LWS::Config

Inherits:
Hashie::Dash
  • Object
show all
Defined in:
lib/lws/config.rb

Overview

Note:

Either the API token or API token middleware needs to be configured for the library to work properly!

The LWS API configuration class

This class represents the configuration that is used for connecting to LWS.

Instance Attribute Summary collapse

Instance Attribute Details

#api_tokenString?

Returns the API token necessary to gain access.

Returns:

  • (String, nil)

    the API token necessary to gain access



24
# File 'lib/lws/config.rb', line 24

property :api_token

#api_token_middlewareFaraday::Middleware?

Returns the API token middleware that provides the API token to the request at runtime.

Returns:

  • (Faraday::Middleware, nil)

    the API token middleware that provides the API token to the request at runtime



29
# File 'lib/lws/config.rb', line 29

property :api_token_middleware

#caching_object#read, #write

Returns an object that can cache request results.

Returns:

  • (#read, #write)

    an object that can cache request results



33
# File 'lib/lws/config.rb', line 33

property :caching_object, default: nil

#endpointsHash{Symbol=>String}

Returns a mapping of application endpoint overrides (default: {}).

Returns:

  • (Hash{Symbol=>String})

    a mapping of application endpoint overrides (default: {})



38
# File 'lib/lws/config.rb', line 38

property :endpoints, default: {}

#environmentSymbol

Returns the (default) API environment (default: :production).

Returns:

  • (Symbol)

    the (default) API environment (default: :production)



43
# File 'lib/lws/config.rb', line 43

property :environment, default: :production

#http_debugBoolean

Returns whether to show HTTP debug messages (default: false).

Returns:

  • (Boolean)

    whether to show HTTP debug messages (default: false)



47
# File 'lib/lws/config.rb', line 47

property :http_debug, default: false

#http_debug_headersBoolean

Returns whether to show HTTP headers in the debug messages (default: false).

Returns:

  • (Boolean)

    whether to show HTTP headers in the debug messages (default: false)



52
# File 'lib/lws/config.rb', line 52

property :http_debug_headers, default: false

#json_debugBoolean

Returns whether to show JSON debug messages (default: false).

Returns:

  • (Boolean)

    whether to show JSON debug messages (default: false)



56
# File 'lib/lws/config.rb', line 56

property :json_debug, default: false

#logger#fatal, ...

Returns the logger object (Rails logger, Logger, etc.).

Returns:

  • (#fatal, #error, #warn, #info, #debug)

    the logger object (Rails logger, Logger, etc.)



61
# File 'lib/lws/config.rb', line 61

property :logger

#stubbingString

Returns the path to a directory with stubbing fixtures (setting this enables the default stubs).

Returns:

  • (String)

    the path to a directory with stubbing fixtures (setting this enables the default stubs)



66
# File 'lib/lws/config.rb', line 66

property :stubbing