Function TEST

Source
pub fn TEST<T: Into<VALUE>>(obj: T) -> bool
Expand description

Emulates Ruby’s “if” statement.

  • @param[in] obj An arbitrary ruby object.
  • @retval false obj is either ::RUBY_Qfalse or ::RUBY_Qnil.
  • @retval true Anything else.
use rb_sys::special_consts::*;

assert!(!TEST(Qfalse));
assert!(!TEST(Qnil));
assert!(TEST(Qtrue));