Ruby Introspection API

Rice exposes its internals to Ruby via an introspection API. This API is used by the rice_rbs script to generate RBS Signature Files for a Rice extension.

Enabling

The introspection API is an opt-in feature and therefore must be enabled. To do this requires adding the <rice/api.hpp> header file to your extension and then calling Init_Rice_Api:

#include <rice/api.hpp>

extern "C"
void Init_My_Exgtension()
{
  // Enable Introspection API
  Init_Rice_Api();

  <Add Rice Binding Code>
}

Classes

The Introspection API includes the following classes: