Module: Panko

Defined in:
lib/panko/version.rb,
lib/panko/response.rb,
lib/panko/attribute.rb,
lib/panko/serializer.rb,
lib/panko/association.rb,
lib/panko/array_serializer.rb,
lib/panko/serialization_descriptor.rb,
ext/panko_serializer/panko_serializer.c

Defined Under Namespace

Classes: ArraySerializer, Association, Attribute, JsonValue, ObjectWriter, Response, ResponseCreator, SerializationDescriptor, Serializer, SerializerResolver

Constant Summary collapse

VERSION =
"0.8.4"

Class Method Summary collapse

Class Method Details

._type_cast(*args) ⇒ Object

TODO: pass 3 arguments here



356
357
358
359
360
361
362
363
364
365
# File 'ext/panko_serializer/attributes_writer/type_cast/type_cast.c', line 356

VALUE public_type_cast(int argc, VALUE* argv, VALUE self) {
  VALUE type_metadata, value, isJson;
  rb_scan_args(argc, argv, "21", &type_metadata, &value, &isJson);

  if (isJson == Qnil || isJson == Qundef) {
    isJson = Qfalse;
  }

  return type_cast(type_metadata, value, &isJson);
}

.serialize_object(object, str_writer, descriptor) ⇒ Object



141
142
143
144
145
# File 'ext/panko_serializer/panko_serializer.c', line 141

VALUE serialize_object_api(VALUE klass, VALUE object, VALUE str_writer,
                           VALUE descriptor) {
  SerializationDescriptor sd = sd_read(descriptor);
  return serialize_object(Qnil, object, str_writer, sd);
}

.serialize_objects(objects, str_writer, descriptor) ⇒ Object



147
148
149
150
151
152
# File 'ext/panko_serializer/panko_serializer.c', line 147

VALUE serialize_objects_api(VALUE klass, VALUE objects, VALUE str_writer,
                            VALUE descriptor) {
  serialize_objects(Qnil, objects, str_writer, sd_read(descriptor));

  return Qnil;
}