Class: Access::Config

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

Constant Summary collapse

DOMAINS =
{'production' => '', 'demo' => '-demo', 'stage' => '-stage', 'staging' => '-stage' }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



19
20
21
22
23
24
25
26
27
# File 'lib/access/config.rb', line 19

def initialize
  @access_token = ENV['ACCESS_TOKEN']
  # demo, stage, production
  @api_environment = ENV['ACCESS_ENVIRONMENT'] || 'demo'
  # @api_version = ENV['ACCESS_VERSION'] || 'v1'
  @return_json = ENV['ACCESS_RETURN_JSON'] || 'false'
  # only used when return_json is true
  @hashify = ENV['ACCESS_HASHIFY'] || 'false'
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



17
18
19
# File 'lib/access/config.rb', line 17

def access_token
  @access_token
end

#api_environmentObject

Returns the value of attribute api_environment.



17
18
19
# File 'lib/access/config.rb', line 17

def api_environment
  @api_environment
end

#hashifyObject

Returns the value of attribute hashify.



17
18
19
# File 'lib/access/config.rb', line 17

def hashify
  @hashify
end

#return_jsonObject

Returns the value of attribute return_json.



17
18
19
# File 'lib/access/config.rb', line 17

def return_json
  @return_json
end

Instance Method Details

#resetObject



29
30
31
32
33
34
35
# File 'lib/access/config.rb', line 29

def reset
  self.access_token = ENV['ACCESS_TOKEN']
  self.api_environment = ENV['ACCESS_ENVIRONMENT'] || 'demo'
  # self.api_version = 'v1'
  self.return_json = ENV['ACCESS_RETURN_JSON'] || 'false'
  self.hashify = ENV['ACCESS_HASHIFY'] || 'false'
end