class Protobuf::Field::BaseFieldObjectDefinitions::MapSetMethod

Public Class Methods

new(selph) click to toggle source
# File lib/protobuf/field/base_field_object_definitions.rb, line 127
def initialize(selph)
  @selph = selph
  @name = selph.name
end

Public Instance Methods

call(message_instance, bytes) click to toggle source
# File lib/protobuf/field/base_field_object_definitions.rb, line 132
def call(message_instance, bytes)
  hash = message_instance[@name]
  entry = @selph.decode(bytes)
  # decoded value could be nil for an
  # enum value that is not recognized
  hash[entry.key] = entry.value unless entry.value.nil?
  hash[entry.key]
end