Module: CemAcpt::Goss::Api::DurationHandler

Included in:
ActionResponseResult, ActionResponseSummary
Defined in:
lib/cem_acpt/goss/api/action_response.rb

Defined Under Namespace

Classes: Duration

Constant Summary collapse

DURATION_UNITS =
%i[nanoseconds milliseconds seconds].freeze

Instance Method Summary collapse

Instance Method Details

#duration(unit: :seconds, round: 3) ⇒ Duration

Returns The Duration object.

Parameters:

  • unit (Symbol) (defaults to: :seconds)

    The unit to return the duration in

  • round (Integer) (defaults to: 3)

    The number of decimal places to round to

Returns:



110
111
112
113
114
# File 'lib/cem_acpt/goss/api/action_response.rb', line 110

def duration(unit: :seconds, round: 3)
  @all_durations ||= {}
  @all_durations[unit] ||= {}
  @all_durations[unit][round] ||= Duration.new(@duration, unit, round)
end