Class: TestProf::Vernier::Configuration
- Inherits:
-
Object
- Object
- TestProf::Vernier::Configuration
- Defined in:
- lib/test_prof/vernier.rb
Overview
Vernier configuration
Instance Attribute Summary collapse
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #boot? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #suite? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 29 30 31 |
# File 'lib/test_prof/vernier.rb', line 24 def initialize @mode = ENV.fetch("TEST_VERNIER_MODE", :wall).to_sym @target = (ENV["TEST_VERNIER"] == "boot") ? :boot : :suite sample_interval = ENV["TEST_VERNIER_INTERVAL"].to_i @interval = (sample_interval > 0) ? sample_interval : nil @hooks = ENV["TEST_VERNIER_HOOKS"]&.split(",")&.map { |hook| hook.strip.to_sym } end |
Instance Attribute Details
#hooks ⇒ Object
Returns the value of attribute hooks.
22 23 24 |
# File 'lib/test_prof/vernier.rb', line 22 def hooks @hooks end |
#interval ⇒ Object
Returns the value of attribute interval.
22 23 24 |
# File 'lib/test_prof/vernier.rb', line 22 def interval @interval end |
#mode ⇒ Object
Returns the value of attribute mode.
22 23 24 |
# File 'lib/test_prof/vernier.rb', line 22 def mode @mode end |
#target ⇒ Object
Returns the value of attribute target.
22 23 24 |
# File 'lib/test_prof/vernier.rb', line 22 def target @target end |
Instance Method Details
#boot? ⇒ Boolean
33 34 35 |
# File 'lib/test_prof/vernier.rb', line 33 def boot? target == :boot end |
#suite? ⇒ Boolean
37 38 39 |
# File 'lib/test_prof/vernier.rb', line 37 def suite? target == :suite end |