Class: Semaphore::Configuration
- Inherits:
-
Object
- Object
- Semaphore::Configuration
- Defined in:
- lib/semaphore.rb
Constant Summary collapse
- DEFAULT_API_VERSION =
'v4'.freeze
- DEFAULT_URI_BASE =
'https://api.semaphore.co/api/'.freeze
- DEFAULT_REQUEST_TIMEOUT =
120
Instance Attribute Summary collapse
- #api_key ⇒ Object
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
- #sender_name ⇒ Object
-
#uri_base ⇒ Object
Returns the value of attribute uri_base.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 |
# File 'lib/semaphore.rb', line 19 def initialize @api_key = nil @api_version = DEFAULT_API_VERSION @sender_name = nil @uri_base = DEFAULT_URI_BASE @request_timeout = DEFAULT_REQUEST_TIMEOUT end |
Instance Attribute Details
#api_key ⇒ Object
27 28 29 30 31 32 |
# File 'lib/semaphore.rb', line 27 def api_key return @api_key if @api_key error_text = 'Semaphore access token missing! See https://semaphore.co/docs' raise ConfigurationError, error_text end |
#api_version ⇒ Object
Returns the value of attribute api_version.
13 14 15 |
# File 'lib/semaphore.rb', line 13 def api_version @api_version end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
13 14 15 |
# File 'lib/semaphore.rb', line 13 def request_timeout @request_timeout end |
#sender_name ⇒ Object
34 35 36 37 38 39 |
# File 'lib/semaphore.rb', line 34 def sender_name return @sender_name if @sender_name error_text = 'Semaphore sender name missing! See https://semaphore.co/docs' raise ConfigurationError, error_text end |
#uri_base ⇒ Object
Returns the value of attribute uri_base.
13 14 15 |
# File 'lib/semaphore.rb', line 13 def uri_base @uri_base end |