Class: Workit::Model::Span

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource
Defined in:
lib/workit/model/span.rb

Instance Method Summary collapse

Instance Method Details

#durationObject



14
15
16
# File 'lib/workit/model/span.rb', line 14

def duration
  (self.finished_at || Time.now).to_time.to_i - self.started_at.to_time.to_i
end

#set_started_atObject



18
19
20
# File 'lib/workit/model/span.rb', line 18

def set_started_at
  self.started_at = Time.now
end