Class: Workit::Model::Span
- Inherits:
-
Object
- Object
- Workit::Model::Span
- Includes:
- DataMapper::Resource
- Defined in:
- lib/workit/model/span.rb
Instance Method Summary collapse
Instance Method Details
#duration ⇒ Object
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_at ⇒ Object
18 19 20 |
# File 'lib/workit/model/span.rb', line 18 def set_started_at self.started_at = Time.now end |