Class: Driftrock::Service::Config
- Inherits:
-
Struct
- Object
- Struct
- Driftrock::Service::Config
- Defined in:
- lib/driftrock-service/config.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#log_location ⇒ Object
Returns the value of attribute log_location.
-
#logout_action ⇒ Object
Returns the value of attribute logout_action.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#status_action ⇒ Object
Returns the value of attribute status_action.
-
#status_location ⇒ Object
Returns the value of attribute status_location.
Class Method Summary collapse
- .api_location ⇒ Object
- .api_token ⇒ Object
- .app_id ⇒ Object
- .environment ⇒ Object
- .init {|config_properties| ... } ⇒ Object
- .log_level ⇒ Object
- .log_location ⇒ Object
- .salt ⇒ Object
- .website_location ⇒ Object
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def api_token @api_token end |
#app_id ⇒ Object
Returns the value of attribute app_id
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def app_id @app_id end |
#environment ⇒ Object
Returns the value of attribute environment
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def environment @environment end |
#log_level ⇒ Object
Returns the value of attribute log_level
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def log_level @log_level end |
#log_location ⇒ Object
Returns the value of attribute log_location
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def log_location @log_location end |
#logout_action ⇒ Object
Returns the value of attribute logout_action
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def logout_action @logout_action end |
#salt ⇒ Object
Returns the value of attribute salt
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def salt @salt end |
#status_action ⇒ Object
Returns the value of attribute status_action
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def status_action @status_action end |
#status_location ⇒ Object
Returns the value of attribute status_location
3 4 5 |
# File 'lib/driftrock-service/config.rb', line 3 def status_location @status_location end |
Class Method Details
.api_location ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/driftrock-service/config.rb', line 9 def self.api_location if config_properties.environment == :production "https://driftrock-api.herokuapp.com" else "http://localhost:9393" end end |
.api_token ⇒ Object
21 22 23 |
# File 'lib/driftrock-service/config.rb', line 21 def self.api_token config_properties.api_token end |
.app_id ⇒ Object
25 26 27 |
# File 'lib/driftrock-service/config.rb', line 25 def self.app_id config_properties.app_id end |
.environment ⇒ Object
45 46 47 |
# File 'lib/driftrock-service/config.rb', line 45 def self.environment config_properties.enviroment end |
.init {|config_properties| ... } ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/driftrock-service/config.rb', line 49 def self.init yield(config_properties) if defined?(Rails) && config_properties.app_id status_action = config_properties.status_action logout_action = config_properties.logout_action Rails.application.routes.prepend do get 'driftrock_app_status' => status_action get 'driftrock_logout' => logout_action end end end |
.log_level ⇒ Object
29 30 31 |
# File 'lib/driftrock-service/config.rb', line 29 def self.log_level config_properties.log_level end |
.log_location ⇒ Object
33 34 35 |
# File 'lib/driftrock-service/config.rb', line 33 def self.log_location config_properties.log_location end |
.salt ⇒ Object
17 18 19 |
# File 'lib/driftrock-service/config.rb', line 17 def self.salt config_properties.salt end |
.website_location ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/driftrock-service/config.rb', line 37 def self.website_location if config_properties.environment == :production "http://www.driftrock.com" else "http://localhost:3000" end end |