deimos-ruby 1.16.2 → 1.16.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +2 -0
  4. data/lib/deimos/schema_class/record.rb +7 -1
  5. data/lib/deimos/version.rb +1 -1
  6. data/lib/generators/deimos/schema_class/templates/schema_record.rb.tt +13 -5
  7. data/lib/generators/deimos/schema_class_generator.rb +40 -22
  8. data/regenerate_test_schema_classes.rb +68 -0
  9. data/spec/generators/schema_class/my_schema_spec.rb +16 -0
  10. data/spec/generators/schema_class/my_schema_with_circular_reference_spec.rb +1 -1
  11. data/spec/generators/schema_class/my_schema_with_complex_types_spec.rb +32 -24
  12. data/spec/producer_spec.rb +11 -11
  13. data/spec/schemas/{generated.rb → my_namespace/generated.rb} +28 -32
  14. data/spec/schemas/{my_nested_schema.rb → my_namespace/my_nested_schema.rb} +23 -16
  15. data/spec/schemas/{my_schema.rb → my_namespace/my_schema.rb} +12 -5
  16. data/spec/schemas/my_namespace/my_schema_compound_key.rb +41 -0
  17. data/spec/schemas/my_namespace/my_schema_id_key.rb +36 -0
  18. data/spec/schemas/{my_schema_key.rb → my_namespace/my_schema_key.rb} +3 -3
  19. data/spec/schemas/my_namespace/my_schema_with_boolean.rb +41 -0
  20. data/spec/schemas/{my_schema_with_circular_reference.rb → my_namespace/my_schema_with_circular_reference.rb} +15 -10
  21. data/spec/schemas/{my_schema_with_complex_type.rb → my_namespace/my_schema_with_complex_type.rb} +34 -49
  22. data/spec/schemas/my_namespace/my_schema_with_date_time.rb +56 -0
  23. data/spec/schemas/my_namespace/my_schema_with_id.rb +51 -0
  24. data/spec/schemas/my_namespace/my_schema_with_unique_id.rb +56 -0
  25. data/spec/schemas/my_namespace/wibble.rb +76 -0
  26. data/spec/schemas/my_namespace/widget.rb +56 -0
  27. data/spec/schemas/my_namespace/widget_the_second.rb +56 -0
  28. data/spec/schemas/request/create_topic.rb +36 -0
  29. data/spec/schemas/request/index.rb +36 -0
  30. data/spec/schemas/request/update_request.rb +36 -0
  31. data/spec/schemas/response/create_topic.rb +36 -0
  32. data/spec/schemas/response/index.rb +36 -0
  33. data/spec/schemas/response/update_response.rb +36 -0
  34. data/spec/snapshots/consumers-no-nest.snap +93 -86
  35. data/spec/snapshots/consumers.snap +94 -87
  36. data/spec/snapshots/consumers_and_producers-no-nest.snap +108 -87
  37. data/spec/snapshots/consumers_and_producers.snap +109 -88
  38. data/spec/snapshots/consumers_circular-no-nest.snap +93 -86
  39. data/spec/snapshots/consumers_circular.snap +94 -87
  40. data/spec/snapshots/consumers_complex_types-no-nest.snap +93 -86
  41. data/spec/snapshots/consumers_complex_types.snap +94 -87
  42. data/spec/snapshots/consumers_nested-no-nest.snap +93 -86
  43. data/spec/snapshots/consumers_nested.snap +94 -87
  44. data/spec/snapshots/namespace_folders.snap +111 -90
  45. data/spec/snapshots/producers_with_key-no-nest.snap +94 -87
  46. data/spec/snapshots/producers_with_key.snap +95 -88
  47. data/spec/spec_helper.rb +2 -1
  48. metadata +48 -15
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas
4
+ module Schemas; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.Generated
7
7
  class Generated < Deimos::SchemaClass::Record
@@ -9,27 +9,27 @@ module Schemas
9
9
  ### Secondary Schema Classes ###
10
10
  # Autogenerated Schema for Record at com.my-namespace.ARecord
11
11
  class ARecord < Deimos::SchemaClass::Record
12
-
12
+
13
13
  ### Attribute Accessors ###
14
- # @param value [String]
14
+ # @return [String]
15
15
  attr_accessor :a_record_field
16
-
16
+
17
17
  # @override
18
18
  def initialize(a_record_field: nil)
19
19
  super
20
20
  self.a_record_field = a_record_field
21
21
  end
22
-
22
+
23
23
  # @override
24
24
  def schema
25
25
  'ARecord'
26
26
  end
27
-
27
+
28
28
  # @override
29
29
  def namespace
30
30
  'com.my-namespace'
31
31
  end
32
-
32
+
33
33
  # @override
34
34
  def as_json(_opts={})
35
35
  {
@@ -42,22 +42,11 @@ module Schemas
42
42
  class AnEnum < Deimos::SchemaClass::Enum
43
43
  # @return ['sym1', 'sym2']
44
44
  attr_accessor :an_enum
45
-
46
- # :nodoc:
47
- def initialize(an_enum)
48
- super
49
- self.an_enum = an_enum
50
- end
51
-
45
+
52
46
  # @override
53
47
  def symbols
54
48
  %w(sym1 sym2)
55
49
  end
56
-
57
- # @override
58
- def as_json(_opts={})
59
- @an_enum
60
- end
61
50
  end
62
51
 
63
52
 
@@ -68,34 +57,34 @@ module Schemas
68
57
  attr_reader :a_record
69
58
 
70
59
  ### Attribute Accessors ###
71
- # @param value [String]
60
+ # @return [String]
72
61
  attr_accessor :a_string
73
- # @param value [Integer]
62
+ # @return [Integer]
74
63
  attr_accessor :a_int
75
- # @param value [Integer]
64
+ # @return [Integer]
76
65
  attr_accessor :a_long
77
- # @param value [Float]
66
+ # @return [Float]
78
67
  attr_accessor :a_float
79
- # @param value [Float]
68
+ # @return [Float]
80
69
  attr_accessor :a_double
81
- # @param value [nil, Integer]
70
+ # @return [nil, Integer]
82
71
  attr_accessor :an_optional_int
83
- # @param values [Array<Integer>]
72
+ # @return [Array<Integer>]
84
73
  attr_accessor :an_array
85
- # @param values [Hash<String, String>]
74
+ # @return [Hash<String, String>]
86
75
  attr_accessor :a_map
87
- # @param value [String]
76
+ # @return [String]
88
77
  attr_accessor :timestamp
89
- # @param value [String]
78
+ # @return [String]
90
79
  attr_accessor :message_id
91
80
 
92
81
  ### Attribute Writers ###
93
- # @param value [AnEnum]
82
+ # @return [AnEnum]
94
83
  def an_enum=(value)
95
84
  @an_enum = AnEnum.initialize_from_value(value)
96
85
  end
97
86
 
98
- # @param value [ARecord]
87
+ # @return [ARecord]
99
88
  def a_record=(value)
100
89
  @a_record = ARecord.initialize_from_value(value)
101
90
  end
@@ -138,6 +127,13 @@ module Schemas
138
127
  'com.my-namespace'
139
128
  end
140
129
 
130
+ def self.tombstone(key)
131
+ record = self.new
132
+ record.tombstone_key = key
133
+ record.a_string = key
134
+ record
135
+ end
136
+
141
137
  # @override
142
138
  def as_json(_opts={})
143
139
  {
@@ -156,4 +152,4 @@ module Schemas
156
152
  }
157
153
  end
158
154
  end
159
- end
155
+ end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas
4
+ module Schemas; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.MyNestedSchema
7
7
  class MyNestedSchema < Deimos::SchemaClass::Record
@@ -9,17 +9,17 @@ module Schemas
9
9
  ### Secondary Schema Classes ###
10
10
  # Autogenerated Schema for Record at com.my-namespace.MyNestedRecord
11
11
  class MyNestedRecord < Deimos::SchemaClass::Record
12
-
12
+
13
13
  ### Attribute Accessors ###
14
- # @param value [Integer]
14
+ # @return [Integer]
15
15
  attr_accessor :some_int
16
- # @param value [Float]
16
+ # @return [Float]
17
17
  attr_accessor :some_float
18
- # @param value [String]
18
+ # @return [String]
19
19
  attr_accessor :some_string
20
- # @param value [nil, Integer]
20
+ # @return [nil, Integer]
21
21
  attr_accessor :some_optional_int
22
-
22
+
23
23
  # @override
24
24
  def initialize(some_int: nil,
25
25
  some_float: nil,
@@ -31,17 +31,17 @@ module Schemas
31
31
  self.some_string = some_string
32
32
  self.some_optional_int = some_optional_int
33
33
  end
34
-
34
+
35
35
  # @override
36
36
  def schema
37
37
  'MyNestedRecord'
38
38
  end
39
-
39
+
40
40
  # @override
41
41
  def namespace
42
42
  'com.my-namespace'
43
43
  end
44
-
44
+
45
45
  # @override
46
46
  def as_json(_opts={})
47
47
  {
@@ -61,20 +61,20 @@ module Schemas
61
61
  attr_reader :some_optional_record
62
62
 
63
63
  ### Attribute Accessors ###
64
- # @param value [String]
64
+ # @return [String]
65
65
  attr_accessor :test_id
66
- # @param value [Float]
66
+ # @return [Float]
67
67
  attr_accessor :test_float
68
- # @param values [Array<String>]
68
+ # @return [Array<String>]
69
69
  attr_accessor :test_array
70
70
 
71
71
  ### Attribute Writers ###
72
- # @param value [MyNestedRecord]
72
+ # @return [MyNestedRecord]
73
73
  def some_nested_record=(value)
74
74
  @some_nested_record = MyNestedRecord.initialize_from_value(value)
75
75
  end
76
76
 
77
- # @param value [nil, MyNestedRecord]
77
+ # @return [nil, MyNestedRecord]
78
78
  def some_optional_record=(value)
79
79
  @some_optional_record = MyNestedRecord.initialize_from_value(value)
80
80
  end
@@ -103,6 +103,13 @@ module Schemas
103
103
  'com.my-namespace'
104
104
  end
105
105
 
106
+ def self.tombstone(key)
107
+ record = self.new
108
+ record.tombstone_key = key
109
+ record.test_id = key
110
+ record
111
+ end
112
+
106
113
  # @override
107
114
  def as_json(_opts={})
108
115
  {
@@ -114,4 +121,4 @@ module Schemas
114
121
  }
115
122
  end
116
123
  end
117
- end
124
+ end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas
4
+ module Schemas; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.MySchema
7
7
  class MySchema < Deimos::SchemaClass::Record
@@ -11,13 +11,13 @@ module Schemas
11
11
  attr_reader :payload_key
12
12
 
13
13
  ### Attribute Accessors ###
14
- # @param value [String]
14
+ # @return [String]
15
15
  attr_accessor :test_id
16
- # @param value [Integer]
16
+ # @return [Integer]
17
17
  attr_accessor :some_int
18
18
 
19
19
  ### Attribute Writers ###
20
- # @param value [MySchemaKey]
20
+ # @return [MySchemaKey]
21
21
  def payload_key=(value)
22
22
  @payload_key = MySchemaKey.initialize_from_value(value)
23
23
  end
@@ -42,6 +42,13 @@ module Schemas
42
42
  'com.my-namespace'
43
43
  end
44
44
 
45
+ def self.tombstone(key)
46
+ record = self.new
47
+ record.tombstone_key = MySchemaKey.initialize_from_value(key)
48
+ record.payload_key = key
49
+ record
50
+ end
51
+
45
52
  # @override
46
53
  def as_json(_opts={})
47
54
  {
@@ -51,4 +58,4 @@ module Schemas
51
58
  }
52
59
  end
53
60
  end
54
- end
61
+ end; end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is autogenerated by Deimos, Do NOT modify
4
+ module Schemas; module MyNamespace
5
+ ### Primary Schema Class ###
6
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaCompound_key
7
+ class MySchemaCompoundKey < Deimos::SchemaClass::Record
8
+
9
+ ### Attribute Accessors ###
10
+ # @return [String]
11
+ attr_accessor :part_one
12
+ # @return [String]
13
+ attr_accessor :part_two
14
+
15
+ # @override
16
+ def initialize(part_one: nil,
17
+ part_two: nil)
18
+ super
19
+ self.part_one = part_one
20
+ self.part_two = part_two
21
+ end
22
+
23
+ # @override
24
+ def schema
25
+ 'MySchemaCompound_key'
26
+ end
27
+
28
+ # @override
29
+ def namespace
30
+ 'com.my-namespace'
31
+ end
32
+
33
+ # @override
34
+ def as_json(_opts={})
35
+ {
36
+ 'part_one' => @part_one,
37
+ 'part_two' => @part_two
38
+ }
39
+ end
40
+ end
41
+ end; end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is autogenerated by Deimos, Do NOT modify
4
+ module Schemas; module MyNamespace
5
+ ### Primary Schema Class ###
6
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaId_key
7
+ class MySchemaIdKey < Deimos::SchemaClass::Record
8
+
9
+ ### Attribute Accessors ###
10
+ # @return [Integer]
11
+ attr_accessor :id
12
+
13
+ # @override
14
+ def initialize(id: nil)
15
+ super
16
+ self.id = id
17
+ end
18
+
19
+ # @override
20
+ def schema
21
+ 'MySchemaId_key'
22
+ end
23
+
24
+ # @override
25
+ def namespace
26
+ 'com.my-namespace'
27
+ end
28
+
29
+ # @override
30
+ def as_json(_opts={})
31
+ {
32
+ 'id' => @id
33
+ }
34
+ end
35
+ end
36
+ end; end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas
4
+ module Schemas; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.MySchema_key
7
7
  class MySchemaKey < Deimos::SchemaClass::Record
8
8
 
9
9
  ### Attribute Accessors ###
10
- # @param value [String]
10
+ # @return [String]
11
11
  attr_accessor :test_id
12
12
 
13
13
  # @override
@@ -33,4 +33,4 @@ module Schemas
33
33
  }
34
34
  end
35
35
  end
36
- end
36
+ end; end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is autogenerated by Deimos, Do NOT modify
4
+ module Schemas; module MyNamespace
5
+ ### Primary Schema Class ###
6
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithBooleans
7
+ class MySchemaWithBoolean < Deimos::SchemaClass::Record
8
+
9
+ ### Attribute Accessors ###
10
+ # @return [String]
11
+ attr_accessor :test_id
12
+ # @return [Boolean]
13
+ attr_accessor :some_bool
14
+
15
+ # @override
16
+ def initialize(test_id: nil,
17
+ some_bool: nil)
18
+ super
19
+ self.test_id = test_id
20
+ self.some_bool = some_bool
21
+ end
22
+
23
+ # @override
24
+ def schema
25
+ 'MySchemaWithBooleans'
26
+ end
27
+
28
+ # @override
29
+ def namespace
30
+ 'com.my-namespace'
31
+ end
32
+
33
+ # @override
34
+ def as_json(_opts={})
35
+ {
36
+ 'test_id' => @test_id,
37
+ 'some_bool' => @some_bool
38
+ }
39
+ end
40
+ end
41
+ end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas
4
+ module Schemas; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.MySchemaWithCircularReference
7
7
  class MySchemaWithCircularReference < Deimos::SchemaClass::Record
@@ -9,27 +9,27 @@ module Schemas
9
9
  ### Secondary Schema Classes ###
10
10
  # Autogenerated Schema for Record at com.my-namespace.Property
11
11
  class Property < Deimos::SchemaClass::Record
12
-
12
+
13
13
  ### Attribute Accessors ###
14
- # @param value [Boolean, Integer, Integer, Float, Float, String, Array<Property>, Hash<String, Property>]
14
+ # @return [Boolean, Integer, Integer, Float, Float, String, Array<Property>, Hash<String, Property>]
15
15
  attr_accessor :property
16
-
16
+
17
17
  # @override
18
18
  def initialize(property: nil)
19
19
  super
20
20
  self.property = property
21
21
  end
22
-
22
+
23
23
  # @override
24
24
  def schema
25
25
  'Property'
26
26
  end
27
-
27
+
28
28
  # @override
29
29
  def namespace
30
30
  'com.my-namespace'
31
31
  end
32
-
32
+
33
33
  # @override
34
34
  def as_json(_opts={})
35
35
  {
@@ -44,9 +44,9 @@ module Schemas
44
44
  attr_reader :properties
45
45
 
46
46
  ### Attribute Writers ###
47
- # @param values [Hash<String, Property>]
47
+ # @return [Hash<String, Property>]
48
48
  def properties=(values)
49
- @properties = values.transform_values do |value|
49
+ @properties = values&.transform_values do |value|
50
50
  Property.initialize_from_value(value)
51
51
  end
52
52
  end
@@ -67,6 +67,11 @@ module Schemas
67
67
  'com.my-namespace'
68
68
  end
69
69
 
70
+ def self.tombstone(key)
71
+ record = self.new
72
+ record
73
+ end
74
+
70
75
  # @override
71
76
  def as_json(_opts={})
72
77
  {
@@ -74,4 +79,4 @@ module Schemas
74
79
  }
75
80
  end
76
81
  end
77
- end
82
+ end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas
4
+ module Schemas; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.MySchemaWithComplexTypes
7
7
  class MySchemaWithComplexType < Deimos::SchemaClass::Record
@@ -9,27 +9,27 @@ module Schemas
9
9
  ### Secondary Schema Classes ###
10
10
  # Autogenerated Schema for Record at com.my-namespace.ARecord
11
11
  class ARecord < Deimos::SchemaClass::Record
12
-
12
+
13
13
  ### Attribute Accessors ###
14
- # @param value [String]
14
+ # @return [String]
15
15
  attr_accessor :a_record_field
16
-
16
+
17
17
  # @override
18
18
  def initialize(a_record_field: nil)
19
19
  super
20
20
  self.a_record_field = a_record_field
21
21
  end
22
-
22
+
23
23
  # @override
24
24
  def schema
25
25
  'ARecord'
26
26
  end
27
-
27
+
28
28
  # @override
29
29
  def namespace
30
30
  'com.my-namespace'
31
31
  end
32
-
32
+
33
33
  # @override
34
34
  def as_json(_opts={})
35
35
  {
@@ -42,7 +42,7 @@ module Schemas
42
42
  class AnEnum < Deimos::SchemaClass::Enum
43
43
  # @return ['sym1', 'sym2']
44
44
  attr_accessor :an_enum
45
-
45
+
46
46
  # @override
47
47
  def symbols
48
48
  %w(sym1 sym2)
@@ -53,44 +53,22 @@ module Schemas
53
53
  class AnotherEnum < Deimos::SchemaClass::Enum
54
54
  # @return ['sym3', 'sym4']
55
55
  attr_accessor :another_enum
56
-
57
- # :nodoc:
58
- def initialize(another_enum)
59
- super
60
- self.another_enum = another_enum
61
- end
62
-
56
+
63
57
  # @override
64
58
  def symbols
65
59
  %w(sym3 sym4)
66
60
  end
67
-
68
- # @override
69
- def as_json(_opts={})
70
- @another_enum
71
- end
72
61
  end
73
62
 
74
63
  # Autogenerated Schema for Enum at com.my-namespace.YetAnotherEnum
75
64
  class YetAnotherEnum < Deimos::SchemaClass::Enum
76
65
  # @return ['sym5', 'sym6']
77
66
  attr_accessor :yet_another_enum
78
-
79
- # :nodoc:
80
- def initialize(yet_another_enum)
81
- super
82
- self.yet_another_enum = yet_another_enum
83
- end
84
-
67
+
85
68
  # @override
86
69
  def symbols
87
70
  %w(sym5 sym6)
88
71
  end
89
-
90
- # @override
91
- def as_json(_opts={})
92
- @yet_another_enum
93
- end
94
72
  end
95
73
 
96
74
 
@@ -111,57 +89,57 @@ module Schemas
111
89
  attr_reader :some_enum_with_default
112
90
 
113
91
  ### Attribute Accessors ###
114
- # @param value [String]
92
+ # @return [String]
115
93
  attr_accessor :test_id
116
- # @param value [Float]
94
+ # @return [Float]
117
95
  attr_accessor :test_float
118
- # @param values [Array<String>]
96
+ # @return [Array<String>]
119
97
  attr_accessor :test_string_array
120
- # @param values [Array<Integer>]
98
+ # @return [Array<Integer>]
121
99
  attr_accessor :test_int_array
122
- # @param value [Integer, nil]
100
+ # @return [Integer, nil]
123
101
  attr_accessor :test_optional_int
124
- # @param values [Hash<String, Integer>]
102
+ # @return [Hash<String, Integer>]
125
103
  attr_accessor :some_integer_map
126
104
 
127
105
  ### Attribute Writers ###
128
- # @param value [ARecord]
106
+ # @return [ARecord]
129
107
  def some_record=(value)
130
108
  @some_record = ARecord.initialize_from_value(value)
131
109
  end
132
110
 
133
- # @param value [nil, ARecord]
111
+ # @return [nil, ARecord]
134
112
  def some_optional_record=(value)
135
113
  @some_optional_record = ARecord.initialize_from_value(value)
136
114
  end
137
115
 
138
- # @param values [Array<ARecord>]
116
+ # @return [Array<ARecord>]
139
117
  def some_record_array=(values)
140
- @some_record_array = values.map do |value|
118
+ @some_record_array = values&.map do |value|
141
119
  ARecord.initialize_from_value(value)
142
120
  end
143
121
  end
144
122
 
145
- # @param values [Hash<String, ARecord>]
123
+ # @return [Hash<String, ARecord>]
146
124
  def some_record_map=(values)
147
- @some_record_map = values.transform_values do |value|
125
+ @some_record_map = values&.transform_values do |value|
148
126
  ARecord.initialize_from_value(value)
149
127
  end
150
128
  end
151
129
 
152
- # @param values [Array<AnEnum>]
130
+ # @return [Array<AnEnum>]
153
131
  def some_enum_array=(values)
154
- @some_enum_array = values.map do |value|
132
+ @some_enum_array = values&.map do |value|
155
133
  AnEnum.initialize_from_value(value)
156
134
  end
157
135
  end
158
136
 
159
- # @param value [nil, AnotherEnum]
137
+ # @return [nil, AnotherEnum]
160
138
  def some_optional_enum=(value)
161
139
  @some_optional_enum = AnotherEnum.initialize_from_value(value)
162
140
  end
163
141
 
164
- # @param value [YetAnotherEnum]
142
+ # @return [YetAnotherEnum]
165
143
  def some_enum_with_default=(value)
166
144
  @some_enum_with_default = YetAnotherEnum.initialize_from_value(value)
167
145
  end
@@ -206,6 +184,13 @@ module Schemas
206
184
  'com.my-namespace'
207
185
  end
208
186
 
187
+ def self.tombstone(key)
188
+ record = self.new
189
+ record.tombstone_key = key
190
+ record.test_id = key
191
+ record
192
+ end
193
+
209
194
  # @override
210
195
  def as_json(_opts={})
211
196
  {
@@ -225,4 +210,4 @@ module Schemas
225
210
  }
226
211
  end
227
212
  end
228
- end
213
+ end; end