Class: BrokenRecord::JobResult
- Inherits:
-
Object
- Object
- BrokenRecord::JobResult
- Defined in:
- lib/broken_record/job_result.rb
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
Instance Method Summary collapse
- #add_error(error) ⇒ Object
-
#initialize(job) ⇒ JobResult
constructor
A new instance of JobResult.
- #start_timer ⇒ Object
- #stop_timer ⇒ Object
Constructor Details
#initialize(job) ⇒ JobResult
Returns a new instance of JobResult.
5 6 7 8 |
# File 'lib/broken_record/job_result.rb', line 5 def initialize(job) @job = job @errors = [] end |
Instance Attribute Details
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
3 4 5 |
# File 'lib/broken_record/job_result.rb', line 3 def end_time @end_time end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/broken_record/job_result.rb', line 3 def errors @errors end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
3 4 5 |
# File 'lib/broken_record/job_result.rb', line 3 def job @job end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/broken_record/job_result.rb', line 3 def start_time @start_time end |
Instance Method Details
#add_error(error) ⇒ Object
18 19 20 |
# File 'lib/broken_record/job_result.rb', line 18 def add_error(error) @errors << "#{error.red}\n" end |
#start_timer ⇒ Object
10 11 12 |
# File 'lib/broken_record/job_result.rb', line 10 def start_timer @start_time = Time.now end |
#stop_timer ⇒ Object
14 15 16 |
# File 'lib/broken_record/job_result.rb', line 14 def stop_timer @end_time = Time.now end |