Sha256: 56bb6dce5cccc2bf7c12bdeb1e5673b4450710c89b5a2ac572a7c199dac26c1c

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

#pragma once

#include <ruby.h>

#include "active_record.h"
#include "common.h"
#include "plain.h"
#include "hash.h"

enum ObjectType { UnknownObjectType = 0, ActiveRecord = 1, Plain = 2, Hash = 3 };

typedef struct _AttributesWriter {
  enum ObjectType object_type;

  void (*write_attributes)(VALUE object, VALUE attributes,
                           EachAttributeFunc func, VALUE context);
} AttributesWriter;

/**
 * Infers the attributes writer from the object type
 */
AttributesWriter create_attributes_writer(VALUE object);

/**
 * Creates empty writer
 * Useful when the writer is not known, and you need init something
 */
AttributesWriter create_empty_attributes_writer();

void init_attributes_writer(VALUE mPanko);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
panko_serializer-0.7.7 ext/panko_serializer/attributes_writer/attributes_writer.h