Sha256: 7722ec4b7645f2efc02ace7d55407d4f613ff00112265556c6d16501c49d738a

Contents?: true

Size: 900 Bytes

Versions: 4

Compression:

Stored size: 900 Bytes

Contents

#include "integer_primitive.hpp"

namespace filegdb {

VALUE integer_primitive::_klass = Qnil;

VALUE integer_primitive::klass() {
  return integer_primitive::_klass;
}


VALUE integer_primitive::set_value(VALUE self, VALUE value) {
  CHECK_ARGUMENT_FIXNUM(value);

  integer_primitive *prim = unwrap(self);

  *prim->_value = FIX2INT(value);

  return prim->wrapped();
}

VALUE integer_primitive::get_value(VALUE self) {
  integer_primitive *prim = unwrap(self);
  return INT2FIX(*prim->_value);
}

void integer_primitive::define(VALUE module)
{
  integer_primitive::_klass = rb_define_class_under(module, "IntegerPrimitive", rb_cObject);
  base::define(integer_primitive::_klass, true);
  rb_define_method(integer_primitive::_klass, "value", FGDB_METHOD(integer_primitive::get_value), 0);
  rb_define_method(integer_primitive::_klass, "value=", FGDB_METHOD(integer_primitive::set_value), 1);
}

}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
filegdb-0.0.6 ext/filegdb/integer_primitive.cpp
filegdb-0.0.5 ext/filegdb/integer_primitive.cpp
filegdb-0.0.4 ext/filegdb/integer_primitive.cpp
filegdb-0.0.3 ext/filegdb/integer_primitive.cpp