lib/protocol_buffers/runtime/message.rb in ruby-protocol-buffers-1.0.0 vs lib/protocol_buffers/runtime/message.rb in ruby-protocol-buffers-1.0.1
- old
+ new
@@ -478,9 +478,13 @@
def each_unknown_field # :nodoc:
return unless @unknown_fields
@unknown_fields.each { |tag_int, value| yield tag_int, value }
end
+ def unknown_field_count
+ (@unknown_fields || []).size
+ end
+
# Generate the initialize method using reflection, to improve speed. This is
# called by the generated .pb.rb code, it's not necessary to call this
# method directly.
def self.gen_methods! # :NODOC:
@methods_generated = true