protobuf-cucumber 3.10.7 → 3.10.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protobuf/field/enum_field.rb +1 -1
- data/lib/protobuf/message.rb +1 -1
- data/lib/protobuf/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 101f1a8da0a074c4c67d8de05ae0dabe18c5db8ca0abffe4535d69debf49cc2b
|
4
|
+
data.tar.gz: d78074675e8b5492287991e0f8511e046f9023d9b174038b2998dcfce2172ec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99a5b689627fe434fad7cc431eba2907730340adb38ee8877e4dfb40fd0130670e7116fd01de883cb331636a76939acd56edf3bf643722c754bab93d20849381
|
7
|
+
data.tar.gz: 8180a58b051d27a09dbd68e8a790e591f35d727d06f1bb84edddbcd13056a333618f8d0a0c7c66d36d6d578e1cf2e754d1330d2abbe2bdfa6f2a77c31115ca99
|
@@ -37,7 +37,7 @@ module Protobuf
|
|
37
37
|
type_class.fetch(value) || fail(TypeError, "Invalid Enum value: #{value.inspect} for #{name}")
|
38
38
|
end
|
39
39
|
|
40
|
-
def json_encode(value)
|
40
|
+
def json_encode(value, options={})
|
41
41
|
enum = type_class.enums.find { |e| e.to_i == value }
|
42
42
|
enum.to_s(:name)
|
43
43
|
end
|
data/lib/protobuf/message.rb
CHANGED
@@ -174,7 +174,7 @@ module Protobuf
|
|
174
174
|
value
|
175
175
|
end
|
176
176
|
|
177
|
-
if proto3 && (hashed_value.nil? || value == field.class.default)
|
177
|
+
if proto3 && (hashed_value.nil? || value == field.class.default rescue field.default rescue nil)
|
178
178
|
result.delete(field.name)
|
179
179
|
else
|
180
180
|
key = proto3 ? field.name.to_s.camelize(:lower).to_sym : field.name
|
data/lib/protobuf/version.rb
CHANGED