Sha256: 8b85eb6acaae33f345d8580ab80bbb2d83e5aaea81d3e1eb8c7e9b8c6b56819b

Contents?: true

Size: 550 Bytes

Versions: 35

Compression:

Stored size: 550 Bytes

Contents

#pragma once

#include <rice/rice.hpp>
#include <rice/stl.hpp>

using Rice::Array;
using Rice::Object;

namespace Rice::detail
{
  template<typename T>
  class To_Ruby<std::vector<T>>
  {
  public:
    VALUE convert(std::vector<T> const & x)
    {
      auto a = rb_ary_new2(x.size());
      for (const auto& v : x) {
        detail::protect(rb_ary_push, a, To_Ruby<T>().convert(v));
      }
      return a;
    }
  };
}

inline tomoto::RawDoc buildDoc(std::vector<std::string>& words) {
  tomoto::RawDoc doc;
  doc.rawWords = words;
  return doc;
}

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
tomoto-0.5.1-x86_64-linux ext/tomoto/utils.h
tomoto-0.5.1-x86_64-darwin ext/tomoto/utils.h
tomoto-0.5.1-arm64-darwin ext/tomoto/utils.h
tomoto-0.5.1-aarch64-linux ext/tomoto/utils.h
tomoto-0.5.1 ext/tomoto/utils.h
tomoto-0.5.0-x86_64-linux ext/tomoto/utils.h
tomoto-0.5.0-x86_64-darwin ext/tomoto/utils.h
tomoto-0.5.0-arm64-darwin ext/tomoto/utils.h
tomoto-0.5.0-aarch64-linux ext/tomoto/utils.h
tomoto-0.5.0 ext/tomoto/utils.h
tomoto-0.4.1-x86_64-linux ext/tomoto/utils.h
tomoto-0.4.1-x86_64-darwin ext/tomoto/utils.h
tomoto-0.4.1-arm64-darwin ext/tomoto/utils.h
tomoto-0.4.1-aarch64-linux ext/tomoto/utils.h
tomoto-0.4.1 ext/tomoto/utils.h
tomoto-0.4.0-x86_64-linux ext/tomoto/utils.h
tomoto-0.4.0-x86_64-darwin ext/tomoto/utils.h
tomoto-0.4.0-arm64-darwin ext/tomoto/utils.h
tomoto-0.4.0-aarch64-linux ext/tomoto/utils.h
tomoto-0.4.0 ext/tomoto/utils.h