Sha256: 4f2c16be423dfb728b4afb890c8702447cadea2027b5f511ff10226b28900bac

Contents?: true

Size: 297 Bytes

Versions: 1

Compression:

Stored size: 297 Bytes

Contents

#include <ruby.h>
#include <time.h>

static VALUE
year()
{
  time_t t = time(NULL);
  struct tm *local = localtime(&t);

  return INT2NUM(local->tm_year + 1900);
}

void
Init_fast_year(void)
{
  VALUE module = rb_define_module("FastYear");

  rb_define_module_function(module, "year", year, 0);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fast_year-0.1.0 ext/fast_year/fast_year.c