如何创建 Google::Protobuf::Map 实例 [Ruby]

Nei*_*ale 7 ruby dictionary hashtable hashmap protocol-buffers

我在 ruby​​ 中有一个 protobuf 对象,它有一个映射作为一个参数。我怎样才能创建一个Google::Protobuf::Map?如果我尝试输入标准哈希表,则会收到错误Expected Map instance

- 编辑 -

在这里找到答案: https: //developers.google.com/protocol-buffers/docs/reference/ruby- generated#map-fields,如果有人需要的话。