Class: Crontinel::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/crontinel.rb

Overview

Configuration for the Crontinel client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_keyObject

Returns the value of attribute api_key.



15
16
17
# File 'lib/crontinel.rb', line 15

def api_key
  @api_key
end

#endpointObject

Returns the value of attribute endpoint.



15
16
17
# File 'lib/crontinel.rb', line 15

def endpoint
  @endpoint
end

#open_timeoutObject

Returns the value of attribute open_timeout.



15
16
17
# File 'lib/crontinel.rb', line 15

def open_timeout
  @open_timeout
end

#timeoutObject

Returns the value of attribute timeout.



15
16
17
# File 'lib/crontinel.rb', line 15

def timeout
  @timeout
end

Instance Method Details

#validate!Object

Raises:



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