Sha256: 5611a512a2c7f0aee72c6fcbd57dd0a334470f54b9f3566f5fb4c40db312efa9

Contents?: true

Size: 573 Bytes

Versions: 10

Compression:

Stored size: 573 Bytes

Contents

#include "rr.h"
#include "v8_date.h"
#include "v8_value.h"
#include "v8_ref.h"

using namespace v8;

namespace {
  
  VALUE DateClass;
  
  VALUE New(VALUE self, VALUE time) {
    HandleScope scope;
    return rr_v8_ref_create(self, Date::New(NUM2DBL(rb_funcall(time, rb_intern("to_f"), 0))));
  }
}

void rr_init_v8_date() {
  DateClass = rr_define_class("Date", rr_cV8_C_Value);
  rr_define_singleton_method(DateClass, "New", New, 1);
}

VALUE rr_reflect_v8_date(Handle<Value> value) {
  Local<Date> date(Date::Cast(*value));
  return rr_v8_ref_create(DateClass, date);
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
therubyracer-0.8.0.pre ext/v8/v8_date.cpp
therubyracer-0.7.5 ext/v8/v8_date.cpp
therubyracer-0.7.4 ext/v8/v8_date.cpp
therubyracer-0.7.3 ext/v8/v8_date.cpp
therubyracer-0.7.2 ext/v8/v8_date.cpp
therubyracer-0.7.2.pre ext/v8/v8_date.cpp
therubyracer-0.7.1 ext/v8/v8_date.cpp
therubyracer-0.7.1.pre ext/v8/v8_date.cpp
therubyracer-0.7.0 ext/v8/v8_date.cpp
therubyracer-0.7.0.pre ext/v8/v8_date.cpp