test_bench-telemetry 2.1.0.4 → 2.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 386857a98f0dcebfe1f6149f148aa5305d98e3eb69f570606a99ca6b4fcffa6c
4
- data.tar.gz: a027d08ff64f5028441473b368d40b74a848e25debe24657a19e0a8c83c02c51
3
+ metadata.gz: 8deb57684f33eeadb3402ccf6c05a119ff5e836957cfb00deed4cbbf442a755a
4
+ data.tar.gz: 83e4ceb13ec5766dbbec3d348f41458c1508dc5f98852754a298fd06818f5123
5
5
  SHA512:
6
- metadata.gz: 4170efb187f369e94b33e06e41d595d80e60c187b4299d93264256463583f07cfdc7e1a38cb8dfc157c5c1c423ce520400c967b378ba35b95ab518ddd0b0cb7d
7
- data.tar.gz: 8dcc9cb2af5b5f415d934530cd49893ffc8de9bebd9931505ae6cde9eec80ed7383721ae8c26ca18e002a2051694271040c34bcddee9905c8f8876dc27d1c9e3
6
+ metadata.gz: cf31234b99ed73ea46932a1141746f2b322b82736b6a62122d0ac82aedccbe429ebd698adc9911a27f98c93db6e837794b67c9dedcac4b28506971cd0152c440
7
+ data.tar.gz: cbd88250f3b9cfc0278de0c45605c5c77183506212a426bc597bc1d41497083bb4c4bc1177326b7ebab88de517a470c8ee84b157e096bdecba7c62a8c2039500
@@ -33,6 +33,10 @@ module TestBench
33
33
 
34
34
  module EventType
35
35
  def event_type
36
+ @event_type ||= event_type!
37
+ end
38
+
39
+ def event_type!
36
40
  *, inner_namespace = self.name.split('::')
37
41
 
38
42
  inner_namespace.to_sym
@@ -103,6 +103,18 @@ module TestBench
103
103
  end
104
104
 
105
105
  def self.get(event_type)
106
+ handler_methods[event_type]
107
+ end
108
+
109
+ def self.handler_methods
110
+ @handler_methods ||= Hash.new do |handler_methods, event_type|
111
+ handler_method = get!(event_type)
112
+
113
+ handler_methods[event_type] = handler_method
114
+ end
115
+ end
116
+
117
+ def self.get!(event_type)
106
118
  event_name = Event::EventName.get(event_type)
107
119
 
108
120
  :"handle_#{event_name}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-telemetry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.4
4
+ version: 2.1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2023-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench-random