class Protobuf::Field::BaseField

def set(message_instance, bytes)

FIXME: need to cleanup (rename) this warthog of a method.
def set(message_instance, bytes)
  if packed?
    array = message_instance.__send__(getter)
    method = \
      case wire_type
      when ::Protobuf::WireType::FIXED32 then :read_fixed32
      when ::Protobuf::WireType::FIXED64 then :read_fixed64
      when ::Protobuf::WireType::VARINT  then :read_varint
      end
    stream = StringIO.new(bytes)
    until stream.eof?
      array << decode(::Protobuf::Decoder.__send__(method, stream))
    end
  else
    value = decode(bytes)
    if repeated?
      message_instance.__send__(getter) << value
    else
      message_instance.__send__(setter, value)
    end
  end
end