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.
124 125 126 127 128 129 |
# File 'lib/test_prof/event_prof/profiler.rb', line 124 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.
122 123 124 |
# File 'lib/test_prof/event_prof/profiler.rb', line 122 def profilers @profilers end |
Instance Method Details
#each(&block) ⇒ Object
131 132 133 134 135 136 137 |
# File 'lib/test_prof/event_prof/profiler.rb', line 131 def each(&block) if block @profilers.each(&block) else @profilers.each end end |
#events ⇒ Object
139 140 141 |
# File 'lib/test_prof/event_prof/profiler.rb', line 139 def events @profilers.map(&:event) end |