Class: SemaphoreSMS::Configuration
- Inherits:
-
Object
- Object
- SemaphoreSMS::Configuration
- Defined in:
- lib/semaphore_sms.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.
23 24 25 26 27 28 29 |
# File 'lib/semaphore_sms.rb', line 23 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
31 32 33 34 35 36 |
# File 'lib/semaphore_sms.rb', line 31 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.
17 18 19 |
# File 'lib/semaphore_sms.rb', line 17 def api_version @api_version end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
17 18 19 |
# File 'lib/semaphore_sms.rb', line 17 def request_timeout @request_timeout end |
#sender_name ⇒ Object
38 39 40 41 42 43 |
# File 'lib/semaphore_sms.rb', line 38 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.
17 18 19 |
# File 'lib/semaphore_sms.rb', line 17 def uri_base @uri_base end |