Class: JobTick::Configuration
- Inherits:
-
Object
- Object
- JobTick::Configuration
- Defined in:
- lib/jobtick/configuration.rb
Constant Summary collapse
- DEFAULT_QUEUE_LIMIT =
1000
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#prune ⇒ Object
Returns the value of attribute prune.
-
#queue_limit ⇒ Object
Returns the value of attribute queue_limit.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 |
# File 'lib/jobtick/configuration.rb', line 9 def initialize @endpoint = "https://api.jobtick.app/v1" @environment = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "production" @enabled = @environment == "production" @prune = false @queue_limit = DEFAULT_QUEUE_LIMIT end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/jobtick/configuration.rb', line 7 def api_key @api_key end |
#enabled ⇒ Object
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/jobtick/configuration.rb', line 7 def enabled @enabled end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
7 8 9 |
# File 'lib/jobtick/configuration.rb', line 7 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/jobtick/configuration.rb', line 7 def environment @environment end |
#prune ⇒ Object
Returns the value of attribute prune.
7 8 9 |
# File 'lib/jobtick/configuration.rb', line 7 def prune @prune end |
#queue_limit ⇒ Object
Returns the value of attribute queue_limit.
7 8 9 |
# File 'lib/jobtick/configuration.rb', line 7 def queue_limit @queue_limit end |
Instance Method Details
#enabled? ⇒ Boolean
17 18 19 |
# File 'lib/jobtick/configuration.rb', line 17 def enabled? @enabled && !@api_key.nil? end |