Skip to content

Commit b3a1f14

Browse files
committed
Merge branch 'bdewitt/remove_helpers' of github.com:ruby-protobuf/protobuf into bdewitt/remove_helpers
2 parents b05b192 + a993f92 commit b3a1f14

4 files changed

Lines changed: 11 additions & 12 deletions

File tree

lib/protobuf/field/base_field.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def initialize(message_class, rule, type_class, fully_qualified_name, tag, simpl
6969
define_to_message_hash!
7070
define_encode_to_stream!
7171
set_default_value!
72-
tag_encoded
7372
end
7473

7574
##

lib/protobuf/field/base_field_method_definitions.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance)
152152
153153
if value.empty?
154154
values.delete(#{fully_qualified_name_string(selph)})
155-
message_instance._protobuf_message_required_field_tags << #{selph.tag}
155+
message_instance._protobuf_message_unset_required_field_tags << #{selph.tag}
156156
else
157-
message_instance._protobuf_message_required_field_tags.delete(#{selph.tag})
157+
message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag})
158158
values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self)
159159
values[#{fully_qualified_name_string(selph)}].replace(value)
160160
end
@@ -200,9 +200,9 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance)
200200
201201
if value.empty?
202202
values.delete(#{fully_qualified_name_string(selph)})
203-
message_instance._protobuf_message_required_field_tags << #{selph.tag}
203+
message_instance._protobuf_message_unset_required_field_tags << #{selph.tag}
204204
else
205-
message_instance._protobuf_message_required_field_tags.delete(#{selph.tag})
205+
message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag})
206206
values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self)
207207
values[#{fully_qualified_name_string(selph)}].replace(value)
208208
end
@@ -247,9 +247,9 @@ def self.define_string_set_field!(selph)
247247
def set_field(values, value, ignore_nil_for_repeated, message_instance)
248248
if value.nil?
249249
values.delete(#{fully_qualified_name_string(selph)})
250-
message_instance._protobuf_message_required_field_tags << #{selph.tag}
250+
message_instance._protobuf_message_unset_required_field_tags << #{selph.tag}
251251
else
252-
message_instance._protobuf_message_required_field_tags.delete(#{selph.tag})
252+
message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag})
253253
values[#{fully_qualified_name_string(selph)}] = if value.is_a?(String)
254254
value
255255
else
@@ -281,9 +281,9 @@ def self.define_base_set_field!(selph)
281281
def set_field(values, value, ignore_nil_for_repeated, message_instance)
282282
if value.nil?
283283
values.delete(#{fully_qualified_name_string(selph)})
284-
message_instance._protobuf_message_required_field_tags << #{selph.tag}
284+
message_instance._protobuf_message_unset_required_field_tags << #{selph.tag}
285285
else
286-
message_instance._protobuf_message_required_field_tags.delete(#{selph.tag})
286+
message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag})
287287
values[#{fully_qualified_name_string(selph)}] = coerce!(value)
288288
end
289289
end

lib/protobuf/message.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def each_field
7070
end
7171

7272
def each_field_for_serialization
73-
_protobuf_message_required_field_tags.each do |tag|
73+
_protobuf_message_unset_required_field_tags.each do |tag|
7474
fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{_protobuf_message_field[tag].name} does not have a value."
7575
end
7676

lib/protobuf/message/fields.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def _protobuf_message_field
2727
PROTOBUF_MESSAGE_GET_FIELD
2828
end
2929
30-
def _protobuf_message_required_field_tags
31-
@_protobuf_message_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup
30+
def _protobuf_message_unset_required_field_tags
31+
@_protobuf_message_unset_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup
3232
end
3333
RUBY
3434
end

0 commit comments

Comments
 (0)