Class: Scholarsphere::Client::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/scholarsphere/client/config.rb

Overview

Loads the yaml configuration file for the client. The default location is config/scholarsphere-client.yml and the client will load this file automatically whenever it is invoked.

The configuration file should contain the endpoint of the Scholarsphere API and the API key.

Required

SS4_ENDPOINT:   "https://scholarsphere.psu.edu/api/v1"
SS_CLIENT_KEY:  "[key]"

Optional

SS_CLIENT_SSL:  "false"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file = Pathname.pwd.join('config', 'scholarsphere-client.yml')) ⇒ Config

Returns a new instance of Config.

Parameters:

  • file (Pathname) (defaults to: Pathname.pwd.join('config', 'scholarsphere-client.yml'))


31
32
33
34
# File 'lib/scholarsphere/client/config.rb', line 31

def initialize(file = Pathname.pwd.join('config', 'scholarsphere-client.yml'))
  @file = file
  load_config
end

Instance Attribute Details

#filePathname (readonly)

Returns:

  • (Pathname)


28
29
30
# File 'lib/scholarsphere/client/config.rb', line 28

def file
  @file
end