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     => ActiveAttr::Typecasting::BooleanTypecaster,
  ::Protobuf::Field::BytesField    => ActiveAttr::Typecasting::StringTypecaster,
  ::Protobuf::Field::DoubleField   => ActiveAttr::Typecasting::FloatTypecaster,
  ::Protobuf::Field::Fixed32Field  => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Fixed64Field  => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::FloatField    => ActiveAttr::Typecasting::FloatTypecaster,
  ::Protobuf::Field::Int32Field    => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Int64Field    => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sfixed32Field => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sfixed64Field => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sint32Field   => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Sint64Field   => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::StringField   => ActiveAttr::Typecasting::StringTypecaster,
  ::Protobuf::Field::Uint32Field   => ActiveAttr::Typecasting::IntegerTypecaster,
  ::Protobuf::Field::Uint64Field   => ActiveAttr::Typecasting::IntegerTypecaster
}

Instance Method Summary collapse

Instance Method Details

#fields_from_attributes(message_class, attributes) ⇒ Object



30
31
32
# File 'lib/active_remote/serializers/protobuf.rb', line 30

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