Sha256: 6e2f3fab048f5b30e42e59b1aaf645df1eb9abefbd100ac41ede623d51cf1a7c

Contents?: true

Size: 969 Bytes

Versions: 3

Compression:

Stored size: 969 Bytes

Contents

// -*- c++ -*-
#include "rucy/rucy.h"


#include "rucy/exception.h"


namespace Rucy
{


	void
	init ()
	{
		static bool done = false;
		if (done) return;
		done = true;

		rucy_module();
		native_error_class();
		invalid_state_error_class();
		invalid_object_error_class();
		system_error_class();
	}


	Module
	rucy_module ()
	{
		static Module m = define_module("Rucy");
		return m;
	}

	Class
	native_error_class ()
	{
		static Class c =
			rucy_module().define_class("NativeError", rb_eStandardError);
		return c;
	}

	Class
	invalid_state_error_class ()
	{
		static Class c =
			rucy_module().define_class("InvalidStateError", native_error_class());
		return c;
	}

	Class
	invalid_object_error_class ()
	{
		static Class c =
			rucy_module().define_class("InvalidObjectError", native_error_class());
		return c;
	}

	Class
	system_error_class ()
	{
		static Class c =
			rucy_module().define_class("SystemError", native_error_class());
		return c;
	}


}// Rucy

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rucy-0.3 src/rucy.cpp
rucy-0.2.1 src/rucy.cpp
rucy-0.2 src/rucy.cpp