lib/seam/effort.rb in seam-0.0.6 vs lib/seam/effort.rb in seam-0.0.7
- old
+ new
@@ -1,10 +1,11 @@
module Seam
class Effort
attr_accessor :completed_steps
attr_accessor :created_at
attr_accessor :complete
+ attr_accessor :completed_at
attr_accessor :id
attr_accessor :next_execute_at
attr_accessor :next_step
attr_accessor :flow
attr_accessor :data
@@ -29,10 +30,11 @@
effort.flow = HashWithIndifferentAccess.new document['flow']
effort.data = HashWithIndifferentAccess.new document['data']
effort.history = document['history'].map { |x| HashWithIndifferentAccess.new x }
effort.completed_steps = document['completed_steps']
effort.complete = document['complete']
+ effort.completed_at = document['completed_at']
effort
end
end
@@ -58,15 +60,20 @@
def to_hash
{
id: self.id,
created_at: self.created_at,
completed_steps: self.completed_steps,
+ completed_at: self.completed_at,
next_execute_at: self.next_execute_at,
next_step: self.next_step,
flow: self.flow,
data: self.data,
history: self.history,
complete: self.complete,
}
+ end
+
+ def clone
+ Seam::Effort.parse HashWithIndifferentAccess.new(self.to_hash)
end
end
end