Class: TestProf::EventProf::ProfilersGroup
- Inherits:
-
Object
- Object
- TestProf::EventProf::ProfilersGroup
- Defined in:
- lib/test_prof/event_prof/profiler.rb
Overview
Multiple profilers wrapper
Instance Attribute Summary collapse
-
#profilers ⇒ Object
readonly
Returns the value of attribute profilers.
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #events ⇒ Object
-
#initialize(event:, **options) ⇒ ProfilersGroup
constructor
A new instance of ProfilersGroup.
Constructor Details
#initialize(event:, **options) ⇒ ProfilersGroup
Returns a new instance of ProfilersGroup.
125 126 127 128 129 130 |
# File 'lib/test_prof/event_prof/profiler.rb', line 125 def initialize(event:, **) events = event.split(",") @profilers = events.map do |ev| Profiler.new(event: ev, **) end end |
Instance Attribute Details
#profilers ⇒ Object (readonly)
Returns the value of attribute profilers.
123 124 125 |
# File 'lib/test_prof/event_prof/profiler.rb', line 123 def profilers @profilers end |
Instance Method Details
#each(&block) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/test_prof/event_prof/profiler.rb', line 132 def each(&block) if block_given? @profilers.each(&block) else @profilers.each end end |
#events ⇒ Object
140 141 142 |
# File 'lib/test_prof/event_prof/profiler.rb', line 140 def events @profilers.map(&:event) end |