Sha256: 61a957d42438dd64eea57a68938858bfd45b7904e1d09776c4d2f36f946bca9e

Contents?: true

Size: 721 Bytes

Versions: 6

Compression:

Stored size: 721 Bytes

Contents

/*
  Store elements to Numo::<%=class_name%> from other.
  @overload store(other)
  @param [Object] other
  @return [Numo::<%=class_name%>] self
*/
static VALUE
<%=c_func%>(VALUE self, VALUE obj)
{
    VALUE r;

    <% Store.definitions.each do |x| %>
    if (<%=x.condition%>) {
        <%=x.c_func%>(self,obj);
        return self;
    }
    <% end %>

    if (IsNArray(obj)) {
        r = rb_funcall(obj, rb_intern("coerce_cast"), 1, cT);
        if (CLASS_OF(r)==cT) {
            <%=c_func%>(self,r);
            return self;
        }
    }

    rb_raise(nary_eCastError, "unknown conversion from %s to %s",
             rb_class2name(CLASS_OF(obj)),
             rb_class2name(CLASS_OF(self)));
    return self;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
numo-narray-0.9.0.3-x86-mingw32 ext/numo/narray/gen/tmpl/store.c
numo-narray-0.9.0.3-x64-mingw32 ext/numo/narray/gen/tmpl/store.c
numo-narray-0.9.0.3 ext/numo/narray/gen/tmpl/store.c
numo-narray-0.9.0.1-x64-mingw32 ext/numo/narray/gen/tmpl/store.c
numo-narray-0.9.0.1 ext/numo/narray/gen/tmpl/store.c
numo-narray-0.9.0.1-x86-mingw32 ext/numo/narray/gen/tmpl/store.c