2012-05-17 23:03:34 -04:00
|
|
|
#include "rr.h"
|
|
|
|
|
|
|
|
namespace rr {
|
|
|
|
void Signature::Init() {
|
|
|
|
ClassBuilder("Signature").
|
|
|
|
defineMethod("New", &New).
|
|
|
|
store(&Class);
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE Signature::New(int length, VALUE args[], VALUE self) {
|
|
|
|
VALUE receiver; VALUE argc; VALUE argv;
|
|
|
|
rb_scan_args(length, args, "03", &receiver, &argc, &argv);
|
2012-05-23 00:06:21 -04:00
|
|
|
std::vector< v8::Handle<v8::FunctionTemplate> > parameters(NUM2INT(argc));
|
|
|
|
return Signature(v8::Signature::New(FunctionTemplate(receiver), NUM2INT(argc), FunctionTemplate::array(argv, parameters)));
|
2012-05-17 23:03:34 -04:00
|
|
|
}
|
|
|
|
}
|