Sha256: ed6f3af890f8c42bc37f8f9e11e64e474db0e135014986db7e84e5503025f4f7

Contents?: true

Size: 658 Bytes

Versions: 4

Compression:

Stored size: 658 Bytes

Contents

// Include the Ruby headers and goodies
#include "ruby.h"

// Defining a space for information and references about the module to be stored internally
VALUE Faux = Qnil;

// Prototype for the initialization method - Ruby calls this, not you
void Init_faux();

// Prototype for our method 'test1' - methods are prefixed by 'method_' here
VALUE method_test1(VALUE self);

// The initialization method for this module
void Init_faux() {
	Faux = rb_define_module("Faux");
	rb_define_method(Faux, "test1", method_test1, 0);
}

// Our 'test1' method.. it simply returns a value of '10' for now.
VALUE method_test1(VALUE self) {
	int x = 10;
	return INT2NUM(x);
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
setup-5.2.0 test/fixtures/faux-project/ext/faux/faux.c
setup-5.1.0 test/fixtures/faux-project/ext/faux/faux.c
setup-5.0.1 test/fixtures/faux-project/ext/faux/faux.c
setup-5.0.0 test/fixtures/faux-project/ext/faux/faux.c