Class: Whenever::Job
- Inherits:
-
Object
- Object
- Whenever::Job
- Defined in:
- lib/whenever/job.rb
Instance Attribute Summary collapse
-
#at ⇒ Object
readonly
Returns the value of attribute at.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Job
constructor
A new instance of Job.
- #output ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Job
Returns a new instance of Job.
6 7 8 9 10 11 12 13 14 |
# File 'lib/whenever/job.rb', line 6 def initialize( = {}) @options = @at = .delete(:at) @template = .delete(:template) @job_template = .delete(:job_template) || ":job" @options[:output] = Whenever::Output::Redirection.new([:output]).to_s if .has_key?(:output) @options[:environment] ||= :production @options[:path] ||= Whenever.path end |
Instance Attribute Details
#at ⇒ Object (readonly)
Returns the value of attribute at.
4 5 6 |
# File 'lib/whenever/job.rb', line 4 def at @at end |
Instance Method Details
#output ⇒ Object
16 17 18 19 |
# File 'lib/whenever/job.rb', line 16 def output job = process_template(@template, @options).strip process_template(@job_template, { :job => job }).strip end |