Module: BerkeleyLibrary::Location::WorldCat::Config

Extended by:
Config
Includes:
Util::URIs
Included in:
Config
Defined in:
lib/berkeley_library/location/world_cat/config.rb

Constant Summary collapse

ENV_WORLDCAT_API_KEY =

The environment variable from which to read the WorldCat API key.

'LIT_WORLDCAT_API_KEY'.freeze
ENV_WORLDCAT_BASE_URL =

The environment variable from which to read the WorldCat base URL.

'LIT_WORLDCAT_BASE_URL'.freeze
DEFAULT_WORLDCAT_BASE_URL =

The default WorldCat base URL, if ENV_WORLDCAT_BASE_URL is not set.

'https://www.worldcat.org/webservices/'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyString?

Gets the WorldCat API key.

Returns:

  • (String, nil)

    the WorldCat API key, or ‘nil` if not set.



28
29
30
# File 'lib/berkeley_library/location/world_cat/config.rb', line 28

def api_key
  @api_key ||= default_worldcat_api_key
end

Instance Method Details

#base_uriObject



32
33
34
# File 'lib/berkeley_library/location/world_cat/config.rb', line 32

def base_uri
  @base_uri ||= default_worldcat_base_uri
end

#base_uri=(value) ⇒ Object



36
37
38
# File 'lib/berkeley_library/location/world_cat/config.rb', line 36

def base_uri=(value)
  @base_uri = uri_or_nil(value)
end