Class: FactoryBotInstruments::Benchmark

Inherits:
Struct
  • Object
show all
Defined in:
lib/factory_bot_instruments/benchmarking.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#durationObject

Returns the value of attribute duration

Returns:

  • (Object)

    the current value of duration



34
35
36
# File 'lib/factory_bot_instruments/benchmarking.rb', line 34

def duration
  @duration
end

#factoryObject

Returns the value of attribute factory

Returns:

  • (Object)

    the current value of factory



34
35
36
# File 'lib/factory_bot_instruments/benchmarking.rb', line 34

def factory
  @factory
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



34
35
36
# File 'lib/factory_bot_instruments/benchmarking.rb', line 34

def method
  @method
end

Instance Method Details

#to_sObject



35
36
37
38
39
# File 'lib/factory_bot_instruments/benchmarking.rb', line 35

def to_s
  formated_duration = format("%5.3fs", duration)

  "#{formated_duration}: FactoryBot.#{method}(:#{factory})"
end