Created
March 5, 2010 05:10
-
-
Save macks/322461 to your computer and use it in GitHub Desktop.
Experimental patch for http://github.com/macks/ruby-protobuf/issues#issue/3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/protobuf/message/message.rb b/lib/protobuf/message/message.rb | |
index 3083618..856a128 100644 | |
--- a/lib/protobuf/message/message.rb | |
+++ b/lib/protobuf/message/message.rb | |
@@ -120,7 +120,7 @@ module Protobuf | |
def initialize(values={}) | |
@values = {} | |
- self.class.fields.each do |tag, field| | |
+ self.class.fields.to_a.each do |tag, field| | |
unless field.ready? | |
field = field.setup | |
self.class.class_eval {@fields[tag] = field} | |
@@ -131,7 +131,7 @@ module Protobuf | |
end | |
# TODO | |
- self.class.extension_fields.each do |tag, field| | |
+ self.class.extension_fields.to_a.each do |tag, field| | |
unless field.ready? | |
field = field.setup | |
self.class.class_eval {@extension_fields[tag] = field} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment