Class: SharedWorkforce::Configuration
- Inherits:
-
Object
- Object
- SharedWorkforce::Configuration
- Defined in:
- lib/shared_workforce/configuration.rb
Instance Attribute Summary collapse
- #api_key ⇒ Object
- #callback_host ⇒ Object
- #callback_path ⇒ Object
-
#http_end_point ⇒ Object
Returns the value of attribute http_end_point.
- #logger ⇒ Object
-
#request_class ⇒ Object
Returns the value of attribute request_class.
Instance Method Summary collapse
- #callback_url ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 |
# File 'lib/shared_workforce/configuration.rb', line 12 def initialize @http_end_point = "https://api.sharedworkforce.com" @request_class = default_request_class end |
Instance Attribute Details
#api_key ⇒ Object
25 26 27 |
# File 'lib/shared_workforce/configuration.rb', line 25 def api_key @api_key ||= ENV['SHAREDWORKFORCE_API_KEY'] end |
#callback_host ⇒ Object
29 30 31 |
# File 'lib/shared_workforce/configuration.rb', line 29 def callback_host @callback_host ||= ENV['SHAREDWORKFORCE_CALLBACK_HOST'] end |
#callback_path ⇒ Object
21 22 23 |
# File 'lib/shared_workforce/configuration.rb', line 21 def callback_path @callback_path ||= "shared_workforce/task_response" end |
#http_end_point ⇒ Object
Returns the value of attribute http_end_point.
9 10 11 |
# File 'lib/shared_workforce/configuration.rb', line 9 def http_end_point @http_end_point end |
#logger ⇒ Object
33 34 35 |
# File 'lib/shared_workforce/configuration.rb', line 33 def logger @logger ||= default_logger end |
#request_class ⇒ Object
Returns the value of attribute request_class.
10 11 12 |
# File 'lib/shared_workforce/configuration.rb', line 10 def request_class @request_class end |
Instance Method Details
#callback_url ⇒ Object
17 18 19 |
# File 'lib/shared_workforce/configuration.rb', line 17 def callback_url callback_host.to_s + '/' + callback_path.to_s if callback_host end |
#valid? ⇒ Boolean
37 38 39 |
# File 'lib/shared_workforce/configuration.rb', line 37 def valid? api_key.present? end |