module MrbWrap

Overview

Main wrapper module, which should be covering most of the use cases

Defined in:

MrbWrap.cr

Macro Summary

Macro Detail

macro wrap_class(mrb_state, crystal_class, name, under = nil, superclass = nil) #

Wraps a Crystal class directly into an mruby class.

The Crystal class crystal_class will be integrated into the MrbState mrb_state, with name as its new designation, returning an MrbClass.

To inherit from another mruby class, specify an MrbClass as a superclass.

Each class can be defined in a specifiy module by setting superclass to a MrbModule.


[View source]
macro wrap_class_method(mrb_state, crystal_class, name, proc, proc_args = [] of Class) #

Wraps a class method into mruby.

The class method proc of the Crystal class crystal_class will be integrated into the MrbState mrb_state, with the arguments proc_args as an Array of Class.

Its new name will be name.


[View source]
macro wrap_constant(mrb_state, under_module, name, crystal_value) #

Wraps a constant value into mruby.

The value crystal_value will be integrated into the MrbState mrb_state, with the name name and the parent MrbModule under_module.


[View source]
macro wrap_constructor(mrb_state, crystal_class, proc_args = [] of Class) #

Wraps the constructor of a Crystal class into mruby.

The constructor for the Crystal class crystal_class will be integrated into the MrbState mrb_state, with the arguments proc_args as an Array of Class.


[View source]
macro wrap_getter(mrb_state, crystal_class, name, proc) #

Wraps a getter into mruby.

The getter proc of the Crystal class crystal_class will be integrated into the MrbState mrb_state.

Its new name will be name.


[View source]
macro wrap_instance_method(mrb_state, crystal_class, name, proc, proc_args = [] of Class) #

Wraps an instance method into mruby.

The instance method proc of the Crystal class crystal_class will be integrated into the MrbState mrb_state, with the arguments proc_args as an Array of Class.

Its new name will be name.


[View source]
macro wrap_module(mrb_state, crystal_module, name, under = nil) #

Wraps a Crystal module into an mruby module.

The module crystal_module will be integrated into the MrbState mrb_state, with name as its new designation, returning an MrbModule.

The parent module can be specified with the MrbModule argument under.


[View source]
macro wrap_module_function(mrb_state, under_module, name, proc, proc_args = [] of Class) #

Wraps a module function into mruby.

The function proc under the MrbModule under_module will be integrated into the MrbState mrb_state, with the arguments proc_args as an Array of Class.

Its new name will be name.


[View source]
macro wrap_property(mrb_state, crystal_class, name, proc, proc_arg) #

Wraps a property into mruby.

The property proc of the Crystal class crystal_class will be integrated into the MrbState mrb_state, with the argument proc_arg as its respective Class.

Its new name will be name.


[View source]
macro wrap_setter(mrb_state, crystal_class, name, proc, proc_arg) #

Wraps a setter into mruby.

The setter proc (without the =) of the Crystal class crystal_class will be integrated into the MrbState mrb_state, with the argument proc_arg as its respective Class.

Its new name will be name.


[View source]