Class: PDC::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/pdc/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/pdc/config.rb', line 35

def initialize
  # site config
  self.site                = 'http://localhost:8000'
  self.api_root            = 'rest_api/'
  self.ssl_verify_mode     = OpenSSL::SSL::VERIFY_PEER

  # token and authentication
  self.requires_token      = true
  self.token_obtain_path   = 'v1/auth/token/obtain/'
  self.token               = nil

  # logger config
  self.log_level           = :warn
  self.enable_logging      = true
  self.logger              = PDC.logger

  self.cache_store         = nil
  self.disable_caching     = false
end

Instance Attribute Details

#api_rootObject

Returns the value of attribute api_root

Returns:

  • (Object)

    the current value of api_root



22
23
24
# File 'lib/pdc/config.rb', line 22

def api_root
  @api_root
end

#cache_storeObject

Returns the value of attribute cache_store

Returns:

  • (Object)

    the current value of cache_store



22
23
24
# File 'lib/pdc/config.rb', line 22

def cache_store
  @cache_store
end

#disable_cachingObject

Returns the value of attribute disable_caching

Returns:

  • (Object)

    the current value of disable_caching



22
23
24
# File 'lib/pdc/config.rb', line 22

def disable_caching
  @disable_caching
end

#enable_loggingObject

Returns the value of attribute enable_logging

Returns:

  • (Object)

    the current value of enable_logging



22
23
24
# File 'lib/pdc/config.rb', line 22

def enable_logging
  @enable_logging
end

#log_levelObject

Returns the value of attribute log_level

Returns:

  • (Object)

    the current value of log_level



22
23
24
# File 'lib/pdc/config.rb', line 22

def log_level
  @log_level
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



22
23
24
# File 'lib/pdc/config.rb', line 22

def logger
  @logger
end

#requires_tokenObject

Returns the value of attribute requires_token

Returns:

  • (Object)

    the current value of requires_token



22
23
24
# File 'lib/pdc/config.rb', line 22

def requires_token
  @requires_token
end

#siteObject

Returns the value of attribute site

Returns:

  • (Object)

    the current value of site



22
23
24
# File 'lib/pdc/config.rb', line 22

def site
  @site
end

#ssl_verify_modeObject

Returns the value of attribute ssl_verify_mode

Returns:

  • (Object)

    the current value of ssl_verify_mode



22
23
24
# File 'lib/pdc/config.rb', line 22

def ssl_verify_mode
  @ssl_verify_mode
end

#tokenObject

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



22
23
24
# File 'lib/pdc/config.rb', line 22

def token
  @token
end

#token_obtain_pathObject

Returns the value of attribute token_obtain_path

Returns:

  • (Object)

    the current value of token_obtain_path



22
23
24
# File 'lib/pdc/config.rb', line 22

def token_obtain_path
  @token_obtain_path
end