Sha256: 4b823a9c9eadd453df88a632c902529ed17201d0d55876f7fa78db7bc746ef50

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 Bytes

Contents

#ifndef Rice__Object__ipp_
#define Rice__Object__ipp_

#include "protect.hpp"
#include "detail/ruby.hpp"
#include "to_from_ruby.hpp"

#include <vector>

template<typename ...ArgT>
inline Rice::Object Rice::Object::
call(Identifier id, ArgT... args) const
{
  auto asList = this->convert_args<ArgT...>(args...);
  return protect(rb_funcall2, value(), id, (int)asList.size(), &asList[0]);
}

template<typename ...ArgT>
std::vector<VALUE> Rice::Object::convert_args(ArgT&... args) const {
  return std::vector<VALUE>{ to_ruby(args)... };
}

template<typename T>
void Rice::Object::
iv_set(
    Identifier name,
    T const & value)
{
  protect(rb_ivar_set, *this, name.id(), to_ruby(value));
}

#endif // Rice__Object__ipp_

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rice2-2.2.1 rice/Object.ipp
rice2-2.2.0 rice/Object.ipp