Class: OodCore::Job::Task
- Inherits:
-
Object
- Object
- OodCore::Job::Task
- Defined in:
- lib/ood_core/job/task.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#wallclock_time ⇒ Object
readonly
Returns the value of attribute wallclock_time.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, status:, wallclock_time: nil, **_) ⇒ Task
constructor
A new instance of Task.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, status:, wallclock_time: nil, **_) ⇒ Task
Returns a new instance of Task.
6 7 8 9 10 |
# File 'lib/ood_core/job/task.rb', line 6 def initialize(id:, status:, wallclock_time: nil, **_) @id = id.to_s @status = OodCore::Job::Status.new(state: status) @wallclock_time = wallclock_time && wallclock_time.to_i end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/ood_core/job/task.rb', line 4 def id @id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/ood_core/job/task.rb', line 4 def status @status end |
#wallclock_time ⇒ Object (readonly)
Returns the value of attribute wallclock_time.
4 5 6 |
# File 'lib/ood_core/job/task.rb', line 4 def wallclock_time @wallclock_time end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 |
# File 'lib/ood_core/job/task.rb', line 20 def ==(other) self.to_h == other.to_h end |
#to_h ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ood_core/job/task.rb', line 12 def to_h { :id => id, :status => status, :wallclock_time => wallclock_time } end |