Function magnus::define_global_const
source · pub fn define_global_const<T>(name: &str, value: T) -> Result<(), Error>where
T: IntoValue,
Expand description
Define a global constant.
§Panics
Panics if called from a non-Ruby thread. See Ruby::define_global_const
for the non-panicking version.
§Examples
use magnus::{define_global_const, rb_assert};
define_global_const("EXAMPLE", 42).unwrap();
rb_assert!("EXAMPLE == 42");