Class: TestProf::StackProf::Configuration

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

Overview

StackProf configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



29
30
31
32
33
# File 'lib/test_prof/stack_prof.rb', line 29

def initialize
  @mode = ENV.fetch('TEST_STACK_PROF_MODE', :wall).to_sym
  @target = ENV['TEST_STACK_PROF'] == 'boot' ? :boot : :suite
  @raw = ENV['TEST_STACK_PROF_RAW'] != '0'
end

Instance Attribute Details

#intervalObject

Returns the value of attribute interval.



27
28
29
# File 'lib/test_prof/stack_prof.rb', line 27

def interval
  @interval
end

#modeObject

Returns the value of attribute mode.



27
28
29
# File 'lib/test_prof/stack_prof.rb', line 27

def mode
  @mode
end

#rawObject

Returns the value of attribute raw.



27
28
29
# File 'lib/test_prof/stack_prof.rb', line 27

def raw
  @raw
end

#targetObject

Returns the value of attribute target.



27
28
29
# File 'lib/test_prof/stack_prof.rb', line 27

def target
  @target
end

Instance Method Details

#boot?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/test_prof/stack_prof.rb', line 39

def boot?
  target == :boot
end

#raw?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/test_prof/stack_prof.rb', line 35

def raw?
  @raw == true
end

#suite?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/test_prof/stack_prof.rb', line 43

def suite?
  target == :suite
end