Class: Bosh::Cli::TaskTracking::TotalDuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/task_tracking/total_duration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#finished_atObject

Returns the value of attribute finished_at


3
4
5
# File 'lib/cli/task_tracking/total_duration.rb', line 3

def finished_at
  @finished_at
end

#started_atObject

Returns the value of attribute started_at


3
4
5
# File 'lib/cli/task_tracking/total_duration.rb', line 3

def started_at
  @started_at
end

Instance Method Details

#durationObject


15
16
17
# File 'lib/cli/task_tracking/total_duration.rb', line 15

def duration
  @finished_at - @started_at if duration_known?
end

#duration_known?Boolean


19
20
21
# File 'lib/cli/task_tracking/total_duration.rb', line 19

def duration_known?
  !!(@finished_at && @started_at)
end