Module: ActiveRemote::Serializers::Protobuf

Extended by:
ActiveSupport::Concern
Included in:
RPCAdapters::ProtobufAdapter
Defined in:
lib/active_remote/serializers/protobuf.rb

Defined Under Namespace

Modules: ClassMethods Classes: Field, Fields

Constant Summary collapse

TYPECASTER_MAP =
{
  ::Protobuf::Field::BoolField     => ActiveRemote::Typecasting::BooleanTypecaster,
  ::Protobuf::Field::BytesField    => ActiveRemote::Typecasting::StringTypecaster,
  ::Protobuf::Field::DoubleField   => ActiveRemote::Typecasting::FloatTypecaster,
  ::Protobuf::Field::Fixed32Field  => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Fixed64Field  => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::FloatField    => ActiveRemote::Typecasting::FloatTypecaster,
  ::Protobuf::Field::Int32Field    => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Int64Field    => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sfixed32Field => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sfixed64Field => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sint32Field   => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sint64Field   => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::StringField   => ActiveRemote::Typecasting::StringTypecaster,
  ::Protobuf::Field::Uint32Field   => ActiveRemote::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Uint64Field   => ActiveRemote::Typecasting::IntegerTypecaster
}

Instance Method Summary collapse

Instance Method Details

#fields_from_attributes(message_class, attributes) ⇒ Object



32
33
34
# File 'lib/active_remote/serializers/protobuf.rb', line 32

def fields_from_attributes(message_class, attributes)
  Fields.from_attributes(message_class, attributes)
end