Module: ActiveRemote::Serializers::Protobuf

Defined in:
lib/active_remote/serializers/protobuf.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

ATTRIBUTE_TYPES =
{
  ::Protobuf::Field::DoubleField => Float,
  ::Protobuf::Field::FloatField => Float,
  ::Protobuf::Field::Int32Field => Integer,
  ::Protobuf::Field::Int64Field => Integer,
  ::Protobuf::Field::Uint32Field => Integer,
  ::Protobuf::Field::Uint64Field => Integer,
  ::Protobuf::Field::Sint32Field => Integer,
  ::Protobuf::Field::Sint64Field => Integer,
  ::Protobuf::Field::Fixed32Field => Float,
  ::Protobuf::Field::Fixed64Field => Float,
  ::Protobuf::Field::Sfixed32Field => Float,
  ::Protobuf::Field::Sfixed64Field => Float,
  ::Protobuf::Field::StringField => String,
  ::Protobuf::Field::BytesField => String,
  ::Protobuf::Field::BoolField => ::ActiveAttr::Typecasting::Boolean,
  :bool => ::ActiveAttr::Typecasting::Boolean,
  :double => Float,
  :float => Float,
  :int32 => Integer,
  :int64 => Integer,
  :string => String
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



28
29
30
# File 'lib/active_remote/serializers/protobuf.rb', line 28

def self.included(klass)
  klass.extend ::ActiveRemote::Serializers::Protobuf::ClassMethods
end

Instance Method Details

#build_message(message_class, attributes) ⇒ Object



93
94
95
# File 'lib/active_remote/serializers/protobuf.rb', line 93

def build_message(message_class, attributes)
  self.class.build_message(message_class, attributes)
end