Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 02fb929

Browse files
committed
Add optional options field to enum_field.rb. See ruby-protobuf#415.
1 parent 0ad6527 commit 02fb929

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/protobuf/field/enum_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def coerce!(value)
3737
type_class.fetch(value) || fail(TypeError, "Invalid Enum value: #{value.inspect} for #{name}")
3838
end
3939

40-
def json_encode(value)
40+
def json_encode(value, options={})
4141
enum = type_class.enums.find { |e| e.to_i == value }
4242
enum.to_s(:name)
4343
end

0 commit comments

Comments
 (0)