class Protobuf::Message

def to_hash

Return a hash-representation of the given fields for this message type.
def to_hash
  result = Hash.new
  @values.keys.each do |field_name|
    value = __send__(field_name)
    hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value
    result.merge!(field_name => hashed_value)
  end
  return result
end