Class: Crontinel::Config
- Inherits:
-
Object
- Object
- Crontinel::Config
- Defined in:
- lib/crontinel.rb
Overview
Configuration for the Crontinel client
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
17 18 19 20 21 22 |
# File 'lib/crontinel.rb', line 17 def initialize @api_key = nil @endpoint = "https://app.crontinel.com" @timeout = 10 @open_timeout = 5 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
15 16 17 |
# File 'lib/crontinel.rb', line 15 def api_key @api_key end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
15 16 17 |
# File 'lib/crontinel.rb', line 15 def endpoint @endpoint end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
15 16 17 |
# File 'lib/crontinel.rb', line 15 def open_timeout @open_timeout end |
#timeout ⇒ Object
Returns the value of attribute timeout.
15 16 17 |
# File 'lib/crontinel.rb', line 15 def timeout @timeout end |
Instance Method Details
#validate! ⇒ Object
24 25 26 |
# File 'lib/crontinel.rb', line 24 def validate! raise ConfigurationError, "api_key is required" if api_key.nil? || api_key.to_s.strip.empty? end |