Class: TestProf::FactoryProf::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/test_prof/factory_prof.rb

Overview

FactoryProf configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Returns a new instance of Configuration.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/test_prof/factory_prof.rb', line 20

def initialize
  @mode = (ENV["FPROF"] == "flamegraph") ? :flamegraph : :simple
  @printer =
    case ENV["FPROF"]
    when "flamegraph"
      Printers::Flamegraph
    when "nate_heckler"
      Printers::NateHeckler
    else
      Printers::Simple
    end
end

Instance Attribute Details

#mode ⇒ Object

Returns the value of attribute mode.



18
19
20
# File 'lib/test_prof/factory_prof.rb', line 18

def mode
  @mode
end

#printer ⇒ Object

Returns the value of attribute printer.



18
19
20
# File 'lib/test_prof/factory_prof.rb', line 18

def printer
  @printer
end

Instance Method Details

#flamegraph? ⇒ Boolean

Whether we want to generate flamegraphs

Returns:

  • (Boolean)


34
35
36
# File 'lib/test_prof/factory_prof.rb', line 34

def flamegraph?
  @mode == :flamegraph
end