Class: TestProf::FactoryProf::Configuration
- Inherits:
-
Object
- Object
- TestProf::FactoryProf::Configuration
- Defined in:
- lib/test_prof/factory_prof.rb
Overview
FactoryProf configuration
Instance Attribute Summary collapse
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#printer ⇒ Object
Returns the value of attribute printer.
Instance Method Summary collapse
-
#flamegraph? ⇒ Boolean
Whether we want to generate flamegraphs.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/test_prof/factory_prof.rb', line 21 def initialize @mode = (ENV["FPROF"] == "flamegraph") ? :flamegraph : :simple @printer = case ENV["FPROF"] when "flamegraph" Printers::Flamegraph when "nate_heckler" Printers::NateHeckler when "json" Printers::Json else Printers::Simple end end |
Instance Attribute Details
#mode ⇒ Object
Returns the value of attribute mode.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def mode @mode end |
#printer ⇒ Object
Returns the value of attribute printer.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def printer @printer end |
Instance Method Details
#flamegraph? ⇒ Boolean
Whether we want to generate flamegraphs
37 38 39 |
# File 'lib/test_prof/factory_prof.rb', line 37 def flamegraph? @mode == :flamegraph end |