Sha256: 2e1f5d7b01123232ef90bea85928a930672a9198731459305ea5f52ade5fddfa

Contents?: true

Size: 665 Bytes

Versions: 35

Compression:

Stored size: 665 Bytes

Contents

#include "check_ruby_type.hpp"
#include "../Exception.hpp"

void Rice::detail::
check_ruby_type(
    VALUE value,
    VALUE klass,
    bool include_super
    )
{ 
  if( !rb_obj_is_kind_of(value, klass) ||
     (!include_super && rb_obj_class(value) != klass))
  {
    // Not sure why this stuff can't be chained
    VALUE gotV = protect(rb_mod_name, rb_obj_class(value));
    char* got = StringValuePtr(gotV);
    VALUE exptV = protect(rb_mod_name, klass);
    char* expected = StringValuePtr(exptV);

    throw Exception(
        rb_eTypeError,
        "wrong argument type %s (expected %s)",
        got, expected
      );
  }                                 
}

Version data entries

35 entries across 35 versions & 6 rubygems

Version Path
rice-3.0.0 rice/detail/check_ruby_type.cpp
rice2-2.2.1 rice/detail/check_ruby_type.cpp
rice2-2.2.0 rice/detail/check_ruby_type.cpp
rice-2.2.0 rice/detail/check_ruby_type.cpp
rice-2.1.3 rice/detail/check_ruby_type.cpp
rice-2.1.2 rice/detail/check_ruby_type.cpp
rice-2.1.1 rice/detail/check_ruby_type.cpp
rice-2.1.0 rice/detail/check_ruby_type.cpp
rice-2.0.0 rice/detail/check_ruby_type.cpp
rice-1.7.0 rice/detail/check_ruby_type.cpp
rice-1.6.3 rice/detail/check_ruby_type.cpp
jameskilton-rice-1.2.0 rice/detail/check_ruby_type.cpp
rice-1.6.2 rice/detail/check_ruby_type.cpp
rice-1.6.1 rice/detail/check_ruby_type.cpp
rice-1.6.0 rice/detail/check_ruby_type.cpp
rice-1.6.0.pre rice/detail/check_ruby_type.cpp
rice-1.5.3 rice/detail/check_ruby_type.cpp
rice-1.5.2 rice/detail/check_ruby_type.cpp
keyme-rice-1.5.1.keyme1 rice/detail/check_ruby_type.cpp
keyme-rice-1.5.1.keyme rice/detail/check_ruby_type.cpp