module MrbWrap
Overview
Main wrapper module, which should be covering most of the use cases
Defined in:
MrbWrap.crConstant Summary
-
Undef =
Undefined.new
-
Undefined mruby value
Macro Summary
-
wrap_class(mrb_state, crystal_class, name, under = nil, superclass = nil)
Wraps a Crystal class directly into an mruby class.
-
wrap_class_method(mrb_state, crystal_class, name, proc, proc_args = [] of Class)
Wraps a class method into mruby.
-
wrap_class_method_with_keywords(mrb_state, crystal_class, name, proc, keyword_args, regular_args = [] of Class)
Wraps a class method into mruby, using keyword arguments.
-
wrap_constant(mrb_state, under_module, name, crystal_value)
Wraps a constant value into mruby.
-
wrap_constructor(mrb_state, crystal_class, proc_args = [] of Class)
Wraps the constructor of a Crystal class into mruby.
-
wrap_constructor_with_keywords(mrb_state, crystal_class, keyword_args, regular_args = [] of Class)
Wraps the constructor of a Crystal class into mruby, using keyword arguments.
-
wrap_getter(mrb_state, crystal_class, name, proc)
Wraps a getter into mruby.
-
wrap_instance_method(mrb_state, crystal_class, name, proc, proc_args = [] of Class)
Wraps an instance method into mruby.
-
wrap_instance_method_with_keywords(mrb_state, crystal_class, name, proc, keyword_args, regular_args = [] of Class)
Wraps an instance method into mruby, using keyword arguments.
-
wrap_module(mrb_state, crystal_module, name, under = nil)
Wraps a Crystal module into an mruby module.
-
wrap_module_function(mrb_state, under_module, name, proc, proc_args = [] of Class)
Wraps a module function into mruby.
-
wrap_module_function_with_keywords(mrb_state, under_module, name, proc, keyword_args, regular_args = [] of Class)
Wraps a module function into mruby, using keyword arguments.
-
wrap_property(mrb_state, crystal_class, name, proc, proc_arg)
Wraps a property into mruby.
-
wrap_setter(mrb_state, crystal_class, name, proc, proc_arg)
Wraps a setter into mruby.
Macro Detail
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 under to a MrbModule
.
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.
Wraps a class method into mruby, using keyword arguments.
The class method proc of the Crystal class crystal_class will be integrated into the MrbState
mrb_state,
with the arguments regular_args as an Array of Class
and keyword_args as a Hash of Symbol => Class
.
Alternatively, a Tuple
with the Class
and a default value for the Class
can be used instead of the Class
.
Its new name will be name.
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.
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
.
Wraps the constructor of a Crystal class into mruby, using keyword arguments.
The constructor for the Crystal class crystal_class will be integrated into the MrbState
mrb_state,
with the arguments regular_args as an Array of Class
and keyword_args as a Hash of Symbol => Class
.
Alternatively, a Tuple
with the Class
and a default value for the Class
can be used instead of the Class
.
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.
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.
Wraps an instance method into mruby, using keyword arguments.
The instance method proc of the Crystal class crystal_class will be integrated into the MrbState
mrb_state,
with the arguments regular_args as an Array of Class
and keyword_args as a Hash of Symbol => Class
.
Alternatively, a Tuple
with the Class
and a default value for the Class
can be used instead of the Class
.
Its new name will be name.
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.
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.
Wraps a module function into mruby, using keyword arguments.
The function proc under the MrbModule
under_module will be integrated into the MrbState
mrb_state,
with the arguments regular_args as an Array of Class
and keyword_args as a Hash of Symbol => Class
.
Alternatively, a Tuple
with the Class
and a default value for the Class
can be used instead of the Class
.
Its new name will be name.
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.