Class: Driftrock::Service::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/driftrock-service/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token

Returns:

  • (Object)

    the current value of api_token



3
4
5
# File 'lib/driftrock-service/config.rb', line 3

def api_token
  @api_token
end

#app_idObject

Returns the value of attribute app_id

Returns:

  • (Object)

    the current value of app_id



3
4
5
# File 'lib/driftrock-service/config.rb', line 3

def app_id
  @app_id
end

#base_urlObject

Returns the value of attribute base_url

Returns:

  • (Object)

    the current value of base_url



3
4
5
# File 'lib/driftrock-service/config.rb', line 3

def base_url
  @base_url
end

#saltObject

Returns the value of attribute salt

Returns:

  • (Object)

    the current value of salt



3
4
5
# File 'lib/driftrock-service/config.rb', line 3

def salt
  @salt
end

#unauthorised_pathObject

Returns the value of attribute unauthorised_path

Returns:

  • (Object)

    the current value of unauthorised_path



3
4
5
# File 'lib/driftrock-service/config.rb', line 3

def unauthorised_path
  @unauthorised_path
end

Class Method Details

.api_tokenObject



15
16
17
# File 'lib/driftrock-service/config.rb', line 15

def self.api_token
  @config.api_token
end

.app_idObject



23
24
25
# File 'lib/driftrock-service/config.rb', line 23

def self.app_id
  @config.app_id
end

.base_urlObject



7
8
9
# File 'lib/driftrock-service/config.rb', line 7

def self.base_url
  @config.base_url
end

.init {|config| ... } ⇒ Object

Yields:

  • (config)


27
28
29
30
31
32
# File 'lib/driftrock-service/config.rb', line 27

def self.init
  config = new
  yield(config)
  config.base_url.gsub(/\/$/, "")      
  @config = config
end

.saltObject



11
12
13
# File 'lib/driftrock-service/config.rb', line 11

def self.salt
  @config.salt
end

.unauthorised_pathObject



19
20
21
# File 'lib/driftrock-service/config.rb', line 19

def self.unauthorised_path
  @config.unauthorised_path
end