Class: Scheduler::Configuration
- Inherits:
-
Object
- Object
- Scheduler::Configuration
- Defined in:
- lib/scheduler/configuration.rb
Instance Attribute Summary collapse
-
#environment ⇒ String
Envinronment of your app.
-
#job_class ⇒ Class
The class of the main job model.
-
#log_file ⇒ String
A path to the specified log file.
-
#max_concurrent_jobs ⇒ Integer
Maximum number of concurent jobs.
-
#mongoid_config_file ⇒ String
A path to Mongoid config file.
-
#perform_jobs_in_test_or_development ⇒ Proc
Whether to perform jobs when in test or development env.
-
#polling_interval ⇒ Integer
How much time to wait before each iteration.
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 26 27 |
# File 'lib/scheduler/configuration.rb', line 19 def initialize @environment = 'test' @mongoid_config_file = File.join(Scheduler.root, 'spec/mongoid.yml') @log_file = STDOUT @job_class = Scheduler::Examples::SchedulableModel @polling_interval = 5 @max_concurrent_jobs = [ Etc.nprocessors, 24 ].min @perform_jobs_in_test_or_development = false end |
Instance Attribute Details
#environment ⇒ String
Returns envinronment of your app.
5 6 7 |
# File 'lib/scheduler/configuration.rb', line 5 def environment @environment end |
#job_class ⇒ Class
Returns the class of the main job model.
11 12 13 |
# File 'lib/scheduler/configuration.rb', line 11 def job_class @job_class end |
#log_file ⇒ String
Returns a path to the specified log file.
9 10 11 |
# File 'lib/scheduler/configuration.rb', line 9 def log_file @log_file end |
#max_concurrent_jobs ⇒ Integer
Returns maximum number of concurent jobs.
15 16 17 |
# File 'lib/scheduler/configuration.rb', line 15 def max_concurrent_jobs @max_concurrent_jobs end |
#mongoid_config_file ⇒ String
Returns a path to Mongoid config file.
7 8 9 |
# File 'lib/scheduler/configuration.rb', line 7 def mongoid_config_file @mongoid_config_file end |
#perform_jobs_in_test_or_development ⇒ Proc
Returns whether to perform jobs when in test or development env.
17 18 19 |
# File 'lib/scheduler/configuration.rb', line 17 def perform_jobs_in_test_or_development @perform_jobs_in_test_or_development end |
#polling_interval ⇒ Integer
Returns how much time to wait before each iteration.
13 14 15 |
# File 'lib/scheduler/configuration.rb', line 13 def polling_interval @polling_interval end |