Class: Access::Config
- Inherits:
-
Object
- Object
- Access::Config
- Defined in:
- lib/access/config.rb
Constant Summary collapse
- DOMAINS =
{'production' => '', 'demo' => '-demo', 'stage' => '-stage', 'staging' => '-stage' }
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_environment ⇒ Object
Returns the value of attribute api_environment.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#format ⇒ Object
Returns the value of attribute format.
-
#hashify ⇒ Object
Returns the value of attribute hashify.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
19 20 21 22 23 24 25 26 |
# File 'lib/access/config.rb', line 19 def initialize @access_token = ENV['ACCESS_TOKEN'] @format = ENV['ACCESS_FORMAT'] || 'json' # demo, stage, production @api_environment = ENV['ACCESS_ENVIRONMENT'] || 'demo' @api_version = ENV['ACCESS_VERSION'] || 'v1' @hashify = ENV['ACCESS_HASHIFY'] || 'false' end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
17 18 19 |
# File 'lib/access/config.rb', line 17 def access_token @access_token end |
#api_environment ⇒ Object
Returns the value of attribute api_environment.
17 18 19 |
# File 'lib/access/config.rb', line 17 def api_environment @api_environment end |
#api_version ⇒ Object
Returns the value of attribute api_version.
17 18 19 |
# File 'lib/access/config.rb', line 17 def api_version @api_version end |
#format ⇒ Object
Returns the value of attribute format.
17 18 19 |
# File 'lib/access/config.rb', line 17 def format @format end |
#hashify ⇒ Object
Returns the value of attribute hashify.
17 18 19 |
# File 'lib/access/config.rb', line 17 def hashify @hashify end |
Instance Method Details
#reset ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/access/config.rb', line 28 def reset self.access_token = ENV['ACCESS_TOKEN'] self.format = 'json' self.api_environment = 'demo' self.api_version = 'v1' self.hashify = false end |