Class: Whenever::Job::Default
- Inherits:
-
Object
- Object
- Whenever::Job::Default
- Defined in:
- lib/whenever/job_types/default.rb
Instance Attribute Summary collapse
-
#at ⇒ Object
Returns the value of attribute at.
-
#output ⇒ Object
Returns the value of attribute output.
-
#output_redirection ⇒ Object
Returns the value of attribute output_redirection.
-
#task ⇒ Object
Returns the value of attribute task.
Instance Method Summary collapse
- #envvars ⇒ Object
-
#initialize(options = {}) ⇒ Default
constructor
A new instance of Default.
Constructor Details
#initialize(options = {}) ⇒ Default
Returns a new instance of Default.
7 8 9 10 11 12 13 14 15 |
# File 'lib/whenever/job_types/default.rb', line 7 def initialize( = {}) opts = .clone @task = opts.delete(:task) @at = opts.delete(:at) @output_redirection = opts.delete(:output) || :not_set @environment = opts.delete(:environment) || :production @path = opts.delete(:path) || Whenever.path @envvars = opts end |
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at.
5 6 7 |
# File 'lib/whenever/job_types/default.rb', line 5 def at @at end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/whenever/job_types/default.rb', line 5 def output @output end |
#output_redirection ⇒ Object
Returns the value of attribute output_redirection.
5 6 7 |
# File 'lib/whenever/job_types/default.rb', line 5 def output_redirection @output_redirection end |
#task ⇒ Object
Returns the value of attribute task.
5 6 7 |
# File 'lib/whenever/job_types/default.rb', line 5 def task @task end |
Instance Method Details
#envvars ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/whenever/job_types/default.rb', line 21 def envvars if @envvars.is_a?(Array) @envvars.keys.select do |key| key.to_sym != :RAILS_ENV end.collect do |key| "#{key}=#{@envvars[key]}" end.join(' ') + ' ' else @envvars.nil? ? '' : @envvars.to_s + ' ' end end |