Class: Timmy::TargetedTimerDefinition
- Inherits:
-
Object
- Object
- Timmy::TargetedTimerDefinition
- Defined in:
- lib/timmy/targeted_timer_definition.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#start_regex ⇒ Object
readonly
Returns the value of attribute start_regex.
-
#stop_regex ⇒ Object
readonly
Returns the value of attribute stop_regex.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, start_regex:, stop_regex: nil) ⇒ TargetedTimerDefinition
constructor
A new instance of TargetedTimerDefinition.
Constructor Details
#initialize(id, start_regex:, stop_regex: nil) ⇒ TargetedTimerDefinition
Returns a new instance of TargetedTimerDefinition.
19 20 21 22 23 24 |
# File 'lib/timmy/targeted_timer_definition.rb', line 19 def initialize(id, start_regex:, stop_regex: nil) @id = id @start_regex = start_regex @stop_regex = stop_regex end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/timmy/targeted_timer_definition.rb', line 17 def id @id end |
#start_regex ⇒ Object (readonly)
Returns the value of attribute start_regex.
17 18 19 |
# File 'lib/timmy/targeted_timer_definition.rb', line 17 def start_regex @start_regex end |
#stop_regex ⇒ Object (readonly)
Returns the value of attribute stop_regex.
17 18 19 |
# File 'lib/timmy/targeted_timer_definition.rb', line 17 def stop_regex @stop_regex end |
Class Method Details
.add(id, start_regex:, stop_regex: nil) ⇒ Object
4 5 6 |
# File 'lib/timmy/targeted_timer_definition.rb', line 4 def add(id, start_regex:, stop_regex: nil) all.push(self.new(id, start_regex: start_regex, stop_regex: stop_regex)) end |
.all ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/timmy/targeted_timer_definition.rb', line 8 def all @all ||= [ self.new(:docker_build, start_regex: /Step \d+\/\d+ : (?<label>.*)$/, stop_regex: / ---> [0-9a-f]{12}$/) ] end |