cucumber-messages 16.0.1 → 17.0.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: 5dc7353136f14ca646f8548de717c06e42a44fe7fed631fbfc56be51b5c82b7f
4
- data.tar.gz: c654cce5e60eb55e7099af06d20ef3dae13f041fba5168f31a2cd53e437b42cd
3
+ metadata.gz: 3bef092f22949b100942e5cd60551ca25af9da7517d922faccfa43a46d086535
4
+ data.tar.gz: d4eed120887862877c6f9ded70f0e535db4778e990275f6ba5f940bdf5e3edfd
5
5
  SHA512:
6
- metadata.gz: 9319a4c524c81b9ae89d5d0972015bb44b38039d54f4b7bc6a2387a90c2db6c200c8ff02e15a048d88ee117569c004992ff784ad2379241b22b4cde05d3f3c12
7
- data.tar.gz: 3109430754f68352da28323be284797bd9f7a5e131cec07e0e0034f2cf1fd00c23cf1dbe8d93ee07024eafeace3dc3ff0553a7f6cce951749d94d35152e6f26a
6
+ metadata.gz: 9ef92d134420fae388e18862516779a4ef0245eea94daf881107ea7e52070babf977326e62f00a08f4c52c252ccaa5e100dc976d2534a9c987222f0cdd88a339
7
+ data.tar.gz: 614160559fdf8bd094b17cdc8061429b700146517e402aba84b2ec98115d6353d50f801a4c44b197f43b876dda340d1d556501d769f52d1bfe717822d0353bf8
data/README.md CHANGED
@@ -1,2 +1,2 @@
1
- # Cucumber Messages for Ruby (Protocol Buffers)
1
+ # Cucumber Messages for Ruby (JSON schema)
2
2
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 16.0.1
1
+ 17.0.0
@@ -0,0 +1,1180 @@
1
+ require 'cucumber/messages.dtos'
2
+ require 'json'
3
+
4
+ # The code was auto-generated by {this script}[https://github.com/cucumber/common/blob/main/messages/jsonschema/scripts/codegen.rb]
5
+ #
6
+
7
+ module Cucumber
8
+ module Messages
9
+
10
+ class Attachment
11
+
12
+ ##
13
+ # Returns a new Attachment from the given hash.
14
+ # If the hash keys are camelCased, they are properly assigned to the
15
+ # corresponding snake_cased attributes.
16
+ #
17
+ # Cucumber::Messages::Attachment.from_h(some_hash) # => #<Cucumber::Messages::Attachment:0x... ...>
18
+ #
19
+
20
+ def self.from_h(hash)
21
+ return nil if hash.nil?
22
+
23
+ self.new(
24
+ body: hash[:body],
25
+ content_encoding: hash[:contentEncoding],
26
+ file_name: hash[:fileName],
27
+ media_type: hash[:mediaType],
28
+ source: Source.from_h(hash[:source]),
29
+ test_case_started_id: hash[:testCaseStartedId],
30
+ test_step_id: hash[:testStepId],
31
+ url: hash[:url],
32
+ )
33
+ end
34
+ end
35
+
36
+ class Duration
37
+
38
+ ##
39
+ # Returns a new Duration from the given hash.
40
+ # If the hash keys are camelCased, they are properly assigned to the
41
+ # corresponding snake_cased attributes.
42
+ #
43
+ # Cucumber::Messages::Duration.from_h(some_hash) # => #<Cucumber::Messages::Duration:0x... ...>
44
+ #
45
+
46
+ def self.from_h(hash)
47
+ return nil if hash.nil?
48
+
49
+ self.new(
50
+ seconds: hash[:seconds],
51
+ nanos: hash[:nanos],
52
+ )
53
+ end
54
+ end
55
+
56
+ class Envelope
57
+
58
+ ##
59
+ # Returns a new Envelope from the given hash.
60
+ # If the hash keys are camelCased, they are properly assigned to the
61
+ # corresponding snake_cased attributes.
62
+ #
63
+ # Cucumber::Messages::Envelope.from_h(some_hash) # => #<Cucumber::Messages::Envelope:0x... ...>
64
+ #
65
+
66
+ def self.from_h(hash)
67
+ return nil if hash.nil?
68
+
69
+ self.new(
70
+ attachment: Attachment.from_h(hash[:attachment]),
71
+ gherkin_document: GherkinDocument.from_h(hash[:gherkinDocument]),
72
+ hook: Hook.from_h(hash[:hook]),
73
+ meta: Meta.from_h(hash[:meta]),
74
+ parameter_type: ParameterType.from_h(hash[:parameterType]),
75
+ parse_error: ParseError.from_h(hash[:parseError]),
76
+ pickle: Pickle.from_h(hash[:pickle]),
77
+ source: Source.from_h(hash[:source]),
78
+ step_definition: StepDefinition.from_h(hash[:stepDefinition]),
79
+ test_case: TestCase.from_h(hash[:testCase]),
80
+ test_case_finished: TestCaseFinished.from_h(hash[:testCaseFinished]),
81
+ test_case_started: TestCaseStarted.from_h(hash[:testCaseStarted]),
82
+ test_run_finished: TestRunFinished.from_h(hash[:testRunFinished]),
83
+ test_run_started: TestRunStarted.from_h(hash[:testRunStarted]),
84
+ test_step_finished: TestStepFinished.from_h(hash[:testStepFinished]),
85
+ test_step_started: TestStepStarted.from_h(hash[:testStepStarted]),
86
+ undefined_parameter_type: UndefinedParameterType.from_h(hash[:undefinedParameterType]),
87
+ )
88
+ end
89
+ end
90
+
91
+ class GherkinDocument
92
+
93
+ ##
94
+ # Returns a new GherkinDocument from the given hash.
95
+ # If the hash keys are camelCased, they are properly assigned to the
96
+ # corresponding snake_cased attributes.
97
+ #
98
+ # Cucumber::Messages::GherkinDocument.from_h(some_hash) # => #<Cucumber::Messages::GherkinDocument:0x... ...>
99
+ #
100
+
101
+ def self.from_h(hash)
102
+ return nil if hash.nil?
103
+
104
+ self.new(
105
+ uri: hash[:uri],
106
+ feature: Feature.from_h(hash[:feature]),
107
+ comments: hash[:comments]&.map { |item| Comment.from_h(item) },
108
+ )
109
+ end
110
+ end
111
+
112
+ class Background
113
+
114
+ ##
115
+ # Returns a new Background from the given hash.
116
+ # If the hash keys are camelCased, they are properly assigned to the
117
+ # corresponding snake_cased attributes.
118
+ #
119
+ # Cucumber::Messages::Background.from_h(some_hash) # => #<Cucumber::Messages::Background:0x... ...>
120
+ #
121
+
122
+ def self.from_h(hash)
123
+ return nil if hash.nil?
124
+
125
+ self.new(
126
+ location: Location.from_h(hash[:location]),
127
+ keyword: hash[:keyword],
128
+ name: hash[:name],
129
+ description: hash[:description],
130
+ steps: hash[:steps]&.map { |item| Step.from_h(item) },
131
+ id: hash[:id],
132
+ )
133
+ end
134
+ end
135
+
136
+ class Comment
137
+
138
+ ##
139
+ # Returns a new Comment from the given hash.
140
+ # If the hash keys are camelCased, they are properly assigned to the
141
+ # corresponding snake_cased attributes.
142
+ #
143
+ # Cucumber::Messages::Comment.from_h(some_hash) # => #<Cucumber::Messages::Comment:0x... ...>
144
+ #
145
+
146
+ def self.from_h(hash)
147
+ return nil if hash.nil?
148
+
149
+ self.new(
150
+ location: Location.from_h(hash[:location]),
151
+ text: hash[:text],
152
+ )
153
+ end
154
+ end
155
+
156
+ class DataTable
157
+
158
+ ##
159
+ # Returns a new DataTable from the given hash.
160
+ # If the hash keys are camelCased, they are properly assigned to the
161
+ # corresponding snake_cased attributes.
162
+ #
163
+ # Cucumber::Messages::DataTable.from_h(some_hash) # => #<Cucumber::Messages::DataTable:0x... ...>
164
+ #
165
+
166
+ def self.from_h(hash)
167
+ return nil if hash.nil?
168
+
169
+ self.new(
170
+ location: Location.from_h(hash[:location]),
171
+ rows: hash[:rows]&.map { |item| TableRow.from_h(item) },
172
+ )
173
+ end
174
+ end
175
+
176
+ class DocString
177
+
178
+ ##
179
+ # Returns a new DocString from the given hash.
180
+ # If the hash keys are camelCased, they are properly assigned to the
181
+ # corresponding snake_cased attributes.
182
+ #
183
+ # Cucumber::Messages::DocString.from_h(some_hash) # => #<Cucumber::Messages::DocString:0x... ...>
184
+ #
185
+
186
+ def self.from_h(hash)
187
+ return nil if hash.nil?
188
+
189
+ self.new(
190
+ location: Location.from_h(hash[:location]),
191
+ media_type: hash[:mediaType],
192
+ content: hash[:content],
193
+ delimiter: hash[:delimiter],
194
+ )
195
+ end
196
+ end
197
+
198
+ class Examples
199
+
200
+ ##
201
+ # Returns a new Examples from the given hash.
202
+ # If the hash keys are camelCased, they are properly assigned to the
203
+ # corresponding snake_cased attributes.
204
+ #
205
+ # Cucumber::Messages::Examples.from_h(some_hash) # => #<Cucumber::Messages::Examples:0x... ...>
206
+ #
207
+
208
+ def self.from_h(hash)
209
+ return nil if hash.nil?
210
+
211
+ self.new(
212
+ location: Location.from_h(hash[:location]),
213
+ tags: hash[:tags]&.map { |item| Tag.from_h(item) },
214
+ keyword: hash[:keyword],
215
+ name: hash[:name],
216
+ description: hash[:description],
217
+ table_header: TableRow.from_h(hash[:tableHeader]),
218
+ table_body: hash[:tableBody]&.map { |item| TableRow.from_h(item) },
219
+ id: hash[:id],
220
+ )
221
+ end
222
+ end
223
+
224
+ class Feature
225
+
226
+ ##
227
+ # Returns a new Feature from the given hash.
228
+ # If the hash keys are camelCased, they are properly assigned to the
229
+ # corresponding snake_cased attributes.
230
+ #
231
+ # Cucumber::Messages::Feature.from_h(some_hash) # => #<Cucumber::Messages::Feature:0x... ...>
232
+ #
233
+
234
+ def self.from_h(hash)
235
+ return nil if hash.nil?
236
+
237
+ self.new(
238
+ location: Location.from_h(hash[:location]),
239
+ tags: hash[:tags]&.map { |item| Tag.from_h(item) },
240
+ language: hash[:language],
241
+ keyword: hash[:keyword],
242
+ name: hash[:name],
243
+ description: hash[:description],
244
+ children: hash[:children]&.map { |item| FeatureChild.from_h(item) },
245
+ )
246
+ end
247
+ end
248
+
249
+ class FeatureChild
250
+
251
+ ##
252
+ # Returns a new FeatureChild from the given hash.
253
+ # If the hash keys are camelCased, they are properly assigned to the
254
+ # corresponding snake_cased attributes.
255
+ #
256
+ # Cucumber::Messages::FeatureChild.from_h(some_hash) # => #<Cucumber::Messages::FeatureChild:0x... ...>
257
+ #
258
+
259
+ def self.from_h(hash)
260
+ return nil if hash.nil?
261
+
262
+ self.new(
263
+ rule: Rule.from_h(hash[:rule]),
264
+ background: Background.from_h(hash[:background]),
265
+ scenario: Scenario.from_h(hash[:scenario]),
266
+ )
267
+ end
268
+ end
269
+
270
+ class Rule
271
+
272
+ ##
273
+ # Returns a new Rule from the given hash.
274
+ # If the hash keys are camelCased, they are properly assigned to the
275
+ # corresponding snake_cased attributes.
276
+ #
277
+ # Cucumber::Messages::Rule.from_h(some_hash) # => #<Cucumber::Messages::Rule:0x... ...>
278
+ #
279
+
280
+ def self.from_h(hash)
281
+ return nil if hash.nil?
282
+
283
+ self.new(
284
+ location: Location.from_h(hash[:location]),
285
+ tags: hash[:tags]&.map { |item| Tag.from_h(item) },
286
+ keyword: hash[:keyword],
287
+ name: hash[:name],
288
+ description: hash[:description],
289
+ children: hash[:children]&.map { |item| RuleChild.from_h(item) },
290
+ id: hash[:id],
291
+ )
292
+ end
293
+ end
294
+
295
+ class RuleChild
296
+
297
+ ##
298
+ # Returns a new RuleChild from the given hash.
299
+ # If the hash keys are camelCased, they are properly assigned to the
300
+ # corresponding snake_cased attributes.
301
+ #
302
+ # Cucumber::Messages::RuleChild.from_h(some_hash) # => #<Cucumber::Messages::RuleChild:0x... ...>
303
+ #
304
+
305
+ def self.from_h(hash)
306
+ return nil if hash.nil?
307
+
308
+ self.new(
309
+ background: Background.from_h(hash[:background]),
310
+ scenario: Scenario.from_h(hash[:scenario]),
311
+ )
312
+ end
313
+ end
314
+
315
+ class Scenario
316
+
317
+ ##
318
+ # Returns a new Scenario from the given hash.
319
+ # If the hash keys are camelCased, they are properly assigned to the
320
+ # corresponding snake_cased attributes.
321
+ #
322
+ # Cucumber::Messages::Scenario.from_h(some_hash) # => #<Cucumber::Messages::Scenario:0x... ...>
323
+ #
324
+
325
+ def self.from_h(hash)
326
+ return nil if hash.nil?
327
+
328
+ self.new(
329
+ location: Location.from_h(hash[:location]),
330
+ tags: hash[:tags]&.map { |item| Tag.from_h(item) },
331
+ keyword: hash[:keyword],
332
+ name: hash[:name],
333
+ description: hash[:description],
334
+ steps: hash[:steps]&.map { |item| Step.from_h(item) },
335
+ examples: hash[:examples]&.map { |item| Examples.from_h(item) },
336
+ id: hash[:id],
337
+ )
338
+ end
339
+ end
340
+
341
+ class Step
342
+
343
+ ##
344
+ # Returns a new Step from the given hash.
345
+ # If the hash keys are camelCased, they are properly assigned to the
346
+ # corresponding snake_cased attributes.
347
+ #
348
+ # Cucumber::Messages::Step.from_h(some_hash) # => #<Cucumber::Messages::Step:0x... ...>
349
+ #
350
+
351
+ def self.from_h(hash)
352
+ return nil if hash.nil?
353
+
354
+ self.new(
355
+ location: Location.from_h(hash[:location]),
356
+ keyword: hash[:keyword],
357
+ text: hash[:text],
358
+ doc_string: DocString.from_h(hash[:docString]),
359
+ data_table: DataTable.from_h(hash[:dataTable]),
360
+ id: hash[:id],
361
+ )
362
+ end
363
+ end
364
+
365
+ class TableCell
366
+
367
+ ##
368
+ # Returns a new TableCell from the given hash.
369
+ # If the hash keys are camelCased, they are properly assigned to the
370
+ # corresponding snake_cased attributes.
371
+ #
372
+ # Cucumber::Messages::TableCell.from_h(some_hash) # => #<Cucumber::Messages::TableCell:0x... ...>
373
+ #
374
+
375
+ def self.from_h(hash)
376
+ return nil if hash.nil?
377
+
378
+ self.new(
379
+ location: Location.from_h(hash[:location]),
380
+ value: hash[:value],
381
+ )
382
+ end
383
+ end
384
+
385
+ class TableRow
386
+
387
+ ##
388
+ # Returns a new TableRow from the given hash.
389
+ # If the hash keys are camelCased, they are properly assigned to the
390
+ # corresponding snake_cased attributes.
391
+ #
392
+ # Cucumber::Messages::TableRow.from_h(some_hash) # => #<Cucumber::Messages::TableRow:0x... ...>
393
+ #
394
+
395
+ def self.from_h(hash)
396
+ return nil if hash.nil?
397
+
398
+ self.new(
399
+ location: Location.from_h(hash[:location]),
400
+ cells: hash[:cells]&.map { |item| TableCell.from_h(item) },
401
+ id: hash[:id],
402
+ )
403
+ end
404
+ end
405
+
406
+ class Tag
407
+
408
+ ##
409
+ # Returns a new Tag from the given hash.
410
+ # If the hash keys are camelCased, they are properly assigned to the
411
+ # corresponding snake_cased attributes.
412
+ #
413
+ # Cucumber::Messages::Tag.from_h(some_hash) # => #<Cucumber::Messages::Tag:0x... ...>
414
+ #
415
+
416
+ def self.from_h(hash)
417
+ return nil if hash.nil?
418
+
419
+ self.new(
420
+ location: Location.from_h(hash[:location]),
421
+ name: hash[:name],
422
+ id: hash[:id],
423
+ )
424
+ end
425
+ end
426
+
427
+ class Hook
428
+
429
+ ##
430
+ # Returns a new Hook from the given hash.
431
+ # If the hash keys are camelCased, they are properly assigned to the
432
+ # corresponding snake_cased attributes.
433
+ #
434
+ # Cucumber::Messages::Hook.from_h(some_hash) # => #<Cucumber::Messages::Hook:0x... ...>
435
+ #
436
+
437
+ def self.from_h(hash)
438
+ return nil if hash.nil?
439
+
440
+ self.new(
441
+ id: hash[:id],
442
+ source_reference: SourceReference.from_h(hash[:sourceReference]),
443
+ tag_expression: hash[:tagExpression],
444
+ )
445
+ end
446
+ end
447
+
448
+ class Location
449
+
450
+ ##
451
+ # Returns a new Location from the given hash.
452
+ # If the hash keys are camelCased, they are properly assigned to the
453
+ # corresponding snake_cased attributes.
454
+ #
455
+ # Cucumber::Messages::Location.from_h(some_hash) # => #<Cucumber::Messages::Location:0x... ...>
456
+ #
457
+
458
+ def self.from_h(hash)
459
+ return nil if hash.nil?
460
+
461
+ self.new(
462
+ line: hash[:line],
463
+ column: hash[:column],
464
+ )
465
+ end
466
+ end
467
+
468
+ class Meta
469
+
470
+ ##
471
+ # Returns a new Meta from the given hash.
472
+ # If the hash keys are camelCased, they are properly assigned to the
473
+ # corresponding snake_cased attributes.
474
+ #
475
+ # Cucumber::Messages::Meta.from_h(some_hash) # => #<Cucumber::Messages::Meta:0x... ...>
476
+ #
477
+
478
+ def self.from_h(hash)
479
+ return nil if hash.nil?
480
+
481
+ self.new(
482
+ protocol_version: hash[:protocolVersion],
483
+ implementation: Product.from_h(hash[:implementation]),
484
+ runtime: Product.from_h(hash[:runtime]),
485
+ os: Product.from_h(hash[:os]),
486
+ cpu: Product.from_h(hash[:cpu]),
487
+ ci: Ci.from_h(hash[:ci]),
488
+ )
489
+ end
490
+ end
491
+
492
+ class Ci
493
+
494
+ ##
495
+ # Returns a new Ci from the given hash.
496
+ # If the hash keys are camelCased, they are properly assigned to the
497
+ # corresponding snake_cased attributes.
498
+ #
499
+ # Cucumber::Messages::Ci.from_h(some_hash) # => #<Cucumber::Messages::Ci:0x... ...>
500
+ #
501
+
502
+ def self.from_h(hash)
503
+ return nil if hash.nil?
504
+
505
+ self.new(
506
+ name: hash[:name],
507
+ url: hash[:url],
508
+ build_number: hash[:buildNumber],
509
+ git: Git.from_h(hash[:git]),
510
+ )
511
+ end
512
+ end
513
+
514
+ class Git
515
+
516
+ ##
517
+ # Returns a new Git from the given hash.
518
+ # If the hash keys are camelCased, they are properly assigned to the
519
+ # corresponding snake_cased attributes.
520
+ #
521
+ # Cucumber::Messages::Git.from_h(some_hash) # => #<Cucumber::Messages::Git:0x... ...>
522
+ #
523
+
524
+ def self.from_h(hash)
525
+ return nil if hash.nil?
526
+
527
+ self.new(
528
+ remote: hash[:remote],
529
+ revision: hash[:revision],
530
+ branch: hash[:branch],
531
+ tag: hash[:tag],
532
+ )
533
+ end
534
+ end
535
+
536
+ class Product
537
+
538
+ ##
539
+ # Returns a new Product from the given hash.
540
+ # If the hash keys are camelCased, they are properly assigned to the
541
+ # corresponding snake_cased attributes.
542
+ #
543
+ # Cucumber::Messages::Product.from_h(some_hash) # => #<Cucumber::Messages::Product:0x... ...>
544
+ #
545
+
546
+ def self.from_h(hash)
547
+ return nil if hash.nil?
548
+
549
+ self.new(
550
+ name: hash[:name],
551
+ version: hash[:version],
552
+ )
553
+ end
554
+ end
555
+
556
+ class ParameterType
557
+
558
+ ##
559
+ # Returns a new ParameterType from the given hash.
560
+ # If the hash keys are camelCased, they are properly assigned to the
561
+ # corresponding snake_cased attributes.
562
+ #
563
+ # Cucumber::Messages::ParameterType.from_h(some_hash) # => #<Cucumber::Messages::ParameterType:0x... ...>
564
+ #
565
+
566
+ def self.from_h(hash)
567
+ return nil if hash.nil?
568
+
569
+ self.new(
570
+ name: hash[:name],
571
+ regular_expressions: hash[:regularExpressions],
572
+ prefer_for_regular_expression_match: hash[:preferForRegularExpressionMatch],
573
+ use_for_snippets: hash[:useForSnippets],
574
+ id: hash[:id],
575
+ )
576
+ end
577
+ end
578
+
579
+ class ParseError
580
+
581
+ ##
582
+ # Returns a new ParseError from the given hash.
583
+ # If the hash keys are camelCased, they are properly assigned to the
584
+ # corresponding snake_cased attributes.
585
+ #
586
+ # Cucumber::Messages::ParseError.from_h(some_hash) # => #<Cucumber::Messages::ParseError:0x... ...>
587
+ #
588
+
589
+ def self.from_h(hash)
590
+ return nil if hash.nil?
591
+
592
+ self.new(
593
+ source: SourceReference.from_h(hash[:source]),
594
+ message: hash[:message],
595
+ )
596
+ end
597
+ end
598
+
599
+ class Pickle
600
+
601
+ ##
602
+ # Returns a new Pickle from the given hash.
603
+ # If the hash keys are camelCased, they are properly assigned to the
604
+ # corresponding snake_cased attributes.
605
+ #
606
+ # Cucumber::Messages::Pickle.from_h(some_hash) # => #<Cucumber::Messages::Pickle:0x... ...>
607
+ #
608
+
609
+ def self.from_h(hash)
610
+ return nil if hash.nil?
611
+
612
+ self.new(
613
+ id: hash[:id],
614
+ uri: hash[:uri],
615
+ name: hash[:name],
616
+ language: hash[:language],
617
+ steps: hash[:steps]&.map { |item| PickleStep.from_h(item) },
618
+ tags: hash[:tags]&.map { |item| PickleTag.from_h(item) },
619
+ ast_node_ids: hash[:astNodeIds],
620
+ )
621
+ end
622
+ end
623
+
624
+ class PickleDocString
625
+
626
+ ##
627
+ # Returns a new PickleDocString from the given hash.
628
+ # If the hash keys are camelCased, they are properly assigned to the
629
+ # corresponding snake_cased attributes.
630
+ #
631
+ # Cucumber::Messages::PickleDocString.from_h(some_hash) # => #<Cucumber::Messages::PickleDocString:0x... ...>
632
+ #
633
+
634
+ def self.from_h(hash)
635
+ return nil if hash.nil?
636
+
637
+ self.new(
638
+ media_type: hash[:mediaType],
639
+ content: hash[:content],
640
+ )
641
+ end
642
+ end
643
+
644
+ class PickleStep
645
+
646
+ ##
647
+ # Returns a new PickleStep from the given hash.
648
+ # If the hash keys are camelCased, they are properly assigned to the
649
+ # corresponding snake_cased attributes.
650
+ #
651
+ # Cucumber::Messages::PickleStep.from_h(some_hash) # => #<Cucumber::Messages::PickleStep:0x... ...>
652
+ #
653
+
654
+ def self.from_h(hash)
655
+ return nil if hash.nil?
656
+
657
+ self.new(
658
+ argument: PickleStepArgument.from_h(hash[:argument]),
659
+ ast_node_ids: hash[:astNodeIds],
660
+ id: hash[:id],
661
+ text: hash[:text],
662
+ )
663
+ end
664
+ end
665
+
666
+ class PickleStepArgument
667
+
668
+ ##
669
+ # Returns a new PickleStepArgument from the given hash.
670
+ # If the hash keys are camelCased, they are properly assigned to the
671
+ # corresponding snake_cased attributes.
672
+ #
673
+ # Cucumber::Messages::PickleStepArgument.from_h(some_hash) # => #<Cucumber::Messages::PickleStepArgument:0x... ...>
674
+ #
675
+
676
+ def self.from_h(hash)
677
+ return nil if hash.nil?
678
+
679
+ self.new(
680
+ doc_string: PickleDocString.from_h(hash[:docString]),
681
+ data_table: PickleTable.from_h(hash[:dataTable]),
682
+ )
683
+ end
684
+ end
685
+
686
+ class PickleTable
687
+
688
+ ##
689
+ # Returns a new PickleTable from the given hash.
690
+ # If the hash keys are camelCased, they are properly assigned to the
691
+ # corresponding snake_cased attributes.
692
+ #
693
+ # Cucumber::Messages::PickleTable.from_h(some_hash) # => #<Cucumber::Messages::PickleTable:0x... ...>
694
+ #
695
+
696
+ def self.from_h(hash)
697
+ return nil if hash.nil?
698
+
699
+ self.new(
700
+ rows: hash[:rows]&.map { |item| PickleTableRow.from_h(item) },
701
+ )
702
+ end
703
+ end
704
+
705
+ class PickleTableCell
706
+
707
+ ##
708
+ # Returns a new PickleTableCell from the given hash.
709
+ # If the hash keys are camelCased, they are properly assigned to the
710
+ # corresponding snake_cased attributes.
711
+ #
712
+ # Cucumber::Messages::PickleTableCell.from_h(some_hash) # => #<Cucumber::Messages::PickleTableCell:0x... ...>
713
+ #
714
+
715
+ def self.from_h(hash)
716
+ return nil if hash.nil?
717
+
718
+ self.new(
719
+ value: hash[:value],
720
+ )
721
+ end
722
+ end
723
+
724
+ class PickleTableRow
725
+
726
+ ##
727
+ # Returns a new PickleTableRow from the given hash.
728
+ # If the hash keys are camelCased, they are properly assigned to the
729
+ # corresponding snake_cased attributes.
730
+ #
731
+ # Cucumber::Messages::PickleTableRow.from_h(some_hash) # => #<Cucumber::Messages::PickleTableRow:0x... ...>
732
+ #
733
+
734
+ def self.from_h(hash)
735
+ return nil if hash.nil?
736
+
737
+ self.new(
738
+ cells: hash[:cells]&.map { |item| PickleTableCell.from_h(item) },
739
+ )
740
+ end
741
+ end
742
+
743
+ class PickleTag
744
+
745
+ ##
746
+ # Returns a new PickleTag from the given hash.
747
+ # If the hash keys are camelCased, they are properly assigned to the
748
+ # corresponding snake_cased attributes.
749
+ #
750
+ # Cucumber::Messages::PickleTag.from_h(some_hash) # => #<Cucumber::Messages::PickleTag:0x... ...>
751
+ #
752
+
753
+ def self.from_h(hash)
754
+ return nil if hash.nil?
755
+
756
+ self.new(
757
+ name: hash[:name],
758
+ ast_node_id: hash[:astNodeId],
759
+ )
760
+ end
761
+ end
762
+
763
+ class Source
764
+
765
+ ##
766
+ # Returns a new Source from the given hash.
767
+ # If the hash keys are camelCased, they are properly assigned to the
768
+ # corresponding snake_cased attributes.
769
+ #
770
+ # Cucumber::Messages::Source.from_h(some_hash) # => #<Cucumber::Messages::Source:0x... ...>
771
+ #
772
+
773
+ def self.from_h(hash)
774
+ return nil if hash.nil?
775
+
776
+ self.new(
777
+ uri: hash[:uri],
778
+ data: hash[:data],
779
+ media_type: hash[:mediaType],
780
+ )
781
+ end
782
+ end
783
+
784
+ class SourceReference
785
+
786
+ ##
787
+ # Returns a new SourceReference from the given hash.
788
+ # If the hash keys are camelCased, they are properly assigned to the
789
+ # corresponding snake_cased attributes.
790
+ #
791
+ # Cucumber::Messages::SourceReference.from_h(some_hash) # => #<Cucumber::Messages::SourceReference:0x... ...>
792
+ #
793
+
794
+ def self.from_h(hash)
795
+ return nil if hash.nil?
796
+
797
+ self.new(
798
+ uri: hash[:uri],
799
+ java_method: JavaMethod.from_h(hash[:javaMethod]),
800
+ java_stack_trace_element: JavaStackTraceElement.from_h(hash[:javaStackTraceElement]),
801
+ location: Location.from_h(hash[:location]),
802
+ )
803
+ end
804
+ end
805
+
806
+ class JavaMethod
807
+
808
+ ##
809
+ # Returns a new JavaMethod from the given hash.
810
+ # If the hash keys are camelCased, they are properly assigned to the
811
+ # corresponding snake_cased attributes.
812
+ #
813
+ # Cucumber::Messages::JavaMethod.from_h(some_hash) # => #<Cucumber::Messages::JavaMethod:0x... ...>
814
+ #
815
+
816
+ def self.from_h(hash)
817
+ return nil if hash.nil?
818
+
819
+ self.new(
820
+ class_name: hash[:className],
821
+ method_name: hash[:methodName],
822
+ method_parameter_types: hash[:methodParameterTypes],
823
+ )
824
+ end
825
+ end
826
+
827
+ class JavaStackTraceElement
828
+
829
+ ##
830
+ # Returns a new JavaStackTraceElement from the given hash.
831
+ # If the hash keys are camelCased, they are properly assigned to the
832
+ # corresponding snake_cased attributes.
833
+ #
834
+ # Cucumber::Messages::JavaStackTraceElement.from_h(some_hash) # => #<Cucumber::Messages::JavaStackTraceElement:0x... ...>
835
+ #
836
+
837
+ def self.from_h(hash)
838
+ return nil if hash.nil?
839
+
840
+ self.new(
841
+ class_name: hash[:className],
842
+ file_name: hash[:fileName],
843
+ method_name: hash[:methodName],
844
+ )
845
+ end
846
+ end
847
+
848
+ class StepDefinition
849
+
850
+ ##
851
+ # Returns a new StepDefinition from the given hash.
852
+ # If the hash keys are camelCased, they are properly assigned to the
853
+ # corresponding snake_cased attributes.
854
+ #
855
+ # Cucumber::Messages::StepDefinition.from_h(some_hash) # => #<Cucumber::Messages::StepDefinition:0x... ...>
856
+ #
857
+
858
+ def self.from_h(hash)
859
+ return nil if hash.nil?
860
+
861
+ self.new(
862
+ id: hash[:id],
863
+ pattern: StepDefinitionPattern.from_h(hash[:pattern]),
864
+ source_reference: SourceReference.from_h(hash[:sourceReference]),
865
+ )
866
+ end
867
+ end
868
+
869
+ class StepDefinitionPattern
870
+
871
+ ##
872
+ # Returns a new StepDefinitionPattern from the given hash.
873
+ # If the hash keys are camelCased, they are properly assigned to the
874
+ # corresponding snake_cased attributes.
875
+ #
876
+ # Cucumber::Messages::StepDefinitionPattern.from_h(some_hash) # => #<Cucumber::Messages::StepDefinitionPattern:0x... ...>
877
+ #
878
+
879
+ def self.from_h(hash)
880
+ return nil if hash.nil?
881
+
882
+ self.new(
883
+ source: hash[:source],
884
+ type: hash[:type],
885
+ )
886
+ end
887
+ end
888
+
889
+ class TestCase
890
+
891
+ ##
892
+ # Returns a new TestCase from the given hash.
893
+ # If the hash keys are camelCased, they are properly assigned to the
894
+ # corresponding snake_cased attributes.
895
+ #
896
+ # Cucumber::Messages::TestCase.from_h(some_hash) # => #<Cucumber::Messages::TestCase:0x... ...>
897
+ #
898
+
899
+ def self.from_h(hash)
900
+ return nil if hash.nil?
901
+
902
+ self.new(
903
+ id: hash[:id],
904
+ pickle_id: hash[:pickleId],
905
+ test_steps: hash[:testSteps]&.map { |item| TestStep.from_h(item) },
906
+ )
907
+ end
908
+ end
909
+
910
+ class Group
911
+
912
+ ##
913
+ # Returns a new Group from the given hash.
914
+ # If the hash keys are camelCased, they are properly assigned to the
915
+ # corresponding snake_cased attributes.
916
+ #
917
+ # Cucumber::Messages::Group.from_h(some_hash) # => #<Cucumber::Messages::Group:0x... ...>
918
+ #
919
+
920
+ def self.from_h(hash)
921
+ return nil if hash.nil?
922
+
923
+ self.new(
924
+ children: hash[:children]&.map { |item| Group.from_h(item) },
925
+ start: hash[:start],
926
+ value: hash[:value],
927
+ )
928
+ end
929
+ end
930
+
931
+ class StepMatchArgument
932
+
933
+ ##
934
+ # Returns a new StepMatchArgument from the given hash.
935
+ # If the hash keys are camelCased, they are properly assigned to the
936
+ # corresponding snake_cased attributes.
937
+ #
938
+ # Cucumber::Messages::StepMatchArgument.from_h(some_hash) # => #<Cucumber::Messages::StepMatchArgument:0x... ...>
939
+ #
940
+
941
+ def self.from_h(hash)
942
+ return nil if hash.nil?
943
+
944
+ self.new(
945
+ group: Group.from_h(hash[:group]),
946
+ parameter_type_name: hash[:parameterTypeName],
947
+ )
948
+ end
949
+ end
950
+
951
+ class StepMatchArgumentsList
952
+
953
+ ##
954
+ # Returns a new StepMatchArgumentsList from the given hash.
955
+ # If the hash keys are camelCased, they are properly assigned to the
956
+ # corresponding snake_cased attributes.
957
+ #
958
+ # Cucumber::Messages::StepMatchArgumentsList.from_h(some_hash) # => #<Cucumber::Messages::StepMatchArgumentsList:0x... ...>
959
+ #
960
+
961
+ def self.from_h(hash)
962
+ return nil if hash.nil?
963
+
964
+ self.new(
965
+ step_match_arguments: hash[:stepMatchArguments]&.map { |item| StepMatchArgument.from_h(item) },
966
+ )
967
+ end
968
+ end
969
+
970
+ class TestStep
971
+
972
+ ##
973
+ # Returns a new TestStep from the given hash.
974
+ # If the hash keys are camelCased, they are properly assigned to the
975
+ # corresponding snake_cased attributes.
976
+ #
977
+ # Cucumber::Messages::TestStep.from_h(some_hash) # => #<Cucumber::Messages::TestStep:0x... ...>
978
+ #
979
+
980
+ def self.from_h(hash)
981
+ return nil if hash.nil?
982
+
983
+ self.new(
984
+ hook_id: hash[:hookId],
985
+ id: hash[:id],
986
+ pickle_step_id: hash[:pickleStepId],
987
+ step_definition_ids: hash[:stepDefinitionIds],
988
+ step_match_arguments_lists: hash[:stepMatchArgumentsLists]&.map { |item| StepMatchArgumentsList.from_h(item) },
989
+ )
990
+ end
991
+ end
992
+
993
+ class TestCaseFinished
994
+
995
+ ##
996
+ # Returns a new TestCaseFinished from the given hash.
997
+ # If the hash keys are camelCased, they are properly assigned to the
998
+ # corresponding snake_cased attributes.
999
+ #
1000
+ # Cucumber::Messages::TestCaseFinished.from_h(some_hash) # => #<Cucumber::Messages::TestCaseFinished:0x... ...>
1001
+ #
1002
+
1003
+ def self.from_h(hash)
1004
+ return nil if hash.nil?
1005
+
1006
+ self.new(
1007
+ test_case_started_id: hash[:testCaseStartedId],
1008
+ timestamp: Timestamp.from_h(hash[:timestamp]),
1009
+ will_be_retried: hash[:willBeRetried],
1010
+ )
1011
+ end
1012
+ end
1013
+
1014
+ class TestCaseStarted
1015
+
1016
+ ##
1017
+ # Returns a new TestCaseStarted from the given hash.
1018
+ # If the hash keys are camelCased, they are properly assigned to the
1019
+ # corresponding snake_cased attributes.
1020
+ #
1021
+ # Cucumber::Messages::TestCaseStarted.from_h(some_hash) # => #<Cucumber::Messages::TestCaseStarted:0x... ...>
1022
+ #
1023
+
1024
+ def self.from_h(hash)
1025
+ return nil if hash.nil?
1026
+
1027
+ self.new(
1028
+ attempt: hash[:attempt],
1029
+ id: hash[:id],
1030
+ test_case_id: hash[:testCaseId],
1031
+ timestamp: Timestamp.from_h(hash[:timestamp]),
1032
+ )
1033
+ end
1034
+ end
1035
+
1036
+ class TestRunFinished
1037
+
1038
+ ##
1039
+ # Returns a new TestRunFinished from the given hash.
1040
+ # If the hash keys are camelCased, they are properly assigned to the
1041
+ # corresponding snake_cased attributes.
1042
+ #
1043
+ # Cucumber::Messages::TestRunFinished.from_h(some_hash) # => #<Cucumber::Messages::TestRunFinished:0x... ...>
1044
+ #
1045
+
1046
+ def self.from_h(hash)
1047
+ return nil if hash.nil?
1048
+
1049
+ self.new(
1050
+ message: hash[:message],
1051
+ success: hash[:success],
1052
+ timestamp: Timestamp.from_h(hash[:timestamp]),
1053
+ )
1054
+ end
1055
+ end
1056
+
1057
+ class TestRunStarted
1058
+
1059
+ ##
1060
+ # Returns a new TestRunStarted from the given hash.
1061
+ # If the hash keys are camelCased, they are properly assigned to the
1062
+ # corresponding snake_cased attributes.
1063
+ #
1064
+ # Cucumber::Messages::TestRunStarted.from_h(some_hash) # => #<Cucumber::Messages::TestRunStarted:0x... ...>
1065
+ #
1066
+
1067
+ def self.from_h(hash)
1068
+ return nil if hash.nil?
1069
+
1070
+ self.new(
1071
+ timestamp: Timestamp.from_h(hash[:timestamp]),
1072
+ )
1073
+ end
1074
+ end
1075
+
1076
+ class TestStepFinished
1077
+
1078
+ ##
1079
+ # Returns a new TestStepFinished from the given hash.
1080
+ # If the hash keys are camelCased, they are properly assigned to the
1081
+ # corresponding snake_cased attributes.
1082
+ #
1083
+ # Cucumber::Messages::TestStepFinished.from_h(some_hash) # => #<Cucumber::Messages::TestStepFinished:0x... ...>
1084
+ #
1085
+
1086
+ def self.from_h(hash)
1087
+ return nil if hash.nil?
1088
+
1089
+ self.new(
1090
+ test_case_started_id: hash[:testCaseStartedId],
1091
+ test_step_id: hash[:testStepId],
1092
+ test_step_result: TestStepResult.from_h(hash[:testStepResult]),
1093
+ timestamp: Timestamp.from_h(hash[:timestamp]),
1094
+ )
1095
+ end
1096
+ end
1097
+
1098
+ class TestStepResult
1099
+
1100
+ ##
1101
+ # Returns a new TestStepResult from the given hash.
1102
+ # If the hash keys are camelCased, they are properly assigned to the
1103
+ # corresponding snake_cased attributes.
1104
+ #
1105
+ # Cucumber::Messages::TestStepResult.from_h(some_hash) # => #<Cucumber::Messages::TestStepResult:0x... ...>
1106
+ #
1107
+
1108
+ def self.from_h(hash)
1109
+ return nil if hash.nil?
1110
+
1111
+ self.new(
1112
+ duration: Duration.from_h(hash[:duration]),
1113
+ message: hash[:message],
1114
+ status: hash[:status],
1115
+ )
1116
+ end
1117
+ end
1118
+
1119
+ class TestStepStarted
1120
+
1121
+ ##
1122
+ # Returns a new TestStepStarted from the given hash.
1123
+ # If the hash keys are camelCased, they are properly assigned to the
1124
+ # corresponding snake_cased attributes.
1125
+ #
1126
+ # Cucumber::Messages::TestStepStarted.from_h(some_hash) # => #<Cucumber::Messages::TestStepStarted:0x... ...>
1127
+ #
1128
+
1129
+ def self.from_h(hash)
1130
+ return nil if hash.nil?
1131
+
1132
+ self.new(
1133
+ test_case_started_id: hash[:testCaseStartedId],
1134
+ test_step_id: hash[:testStepId],
1135
+ timestamp: Timestamp.from_h(hash[:timestamp]),
1136
+ )
1137
+ end
1138
+ end
1139
+
1140
+ class Timestamp
1141
+
1142
+ ##
1143
+ # Returns a new Timestamp from the given hash.
1144
+ # If the hash keys are camelCased, they are properly assigned to the
1145
+ # corresponding snake_cased attributes.
1146
+ #
1147
+ # Cucumber::Messages::Timestamp.from_h(some_hash) # => #<Cucumber::Messages::Timestamp:0x... ...>
1148
+ #
1149
+
1150
+ def self.from_h(hash)
1151
+ return nil if hash.nil?
1152
+
1153
+ self.new(
1154
+ seconds: hash[:seconds],
1155
+ nanos: hash[:nanos],
1156
+ )
1157
+ end
1158
+ end
1159
+
1160
+ class UndefinedParameterType
1161
+
1162
+ ##
1163
+ # Returns a new UndefinedParameterType from the given hash.
1164
+ # If the hash keys are camelCased, they are properly assigned to the
1165
+ # corresponding snake_cased attributes.
1166
+ #
1167
+ # Cucumber::Messages::UndefinedParameterType.from_h(some_hash) # => #<Cucumber::Messages::UndefinedParameterType:0x... ...>
1168
+ #
1169
+
1170
+ def self.from_h(hash)
1171
+ return nil if hash.nil?
1172
+
1173
+ self.new(
1174
+ expression: hash[:expression],
1175
+ name: hash[:name],
1176
+ )
1177
+ end
1178
+ end
1179
+ end
1180
+ end