Sha256: 516c66ce034bcaa5402ac151246970b79d6cc0d4ebd78101ec92f116b7aed1b2

Contents?: true

Size: 927 Bytes

Versions: 19

Compression:

Stored size: 927 Bytes

Contents

<% children.each do |c|%>
<%= c.result %>

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

    klass = rb_obj_class(obj);

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

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

    <% if is_object %>
    robject_store_numeric(self,obj);
    <% else %>
    rb_raise(cumo_na_eCastError, "unknown conversion from %s to %s",
             rb_class2name(rb_obj_class(obj)),
             rb_class2name(rb_obj_class(self)));
    <% end %>
    return self;
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cumo-0.4.3 ext/cumo/narray/gen/tmpl/store.c
cumo-0.4.2 ext/cumo/narray/gen/tmpl/store.c
cumo-0.4.1 ext/cumo/narray/gen/tmpl/store.c
cumo-0.4.0 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.5 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.4 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.3 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.2 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.1 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.0 ext/cumo/narray/gen/tmpl/store.c
cumo-0.3.0.pre1 ext/cumo/narray/gen/tmpl/store.c
cumo-0.2.5 ext/cumo/narray/gen/tmpl/store.c
cumo-0.2.4 ext/cumo/narray/gen/tmpl/store.c
cumo-0.2.3 ext/cumo/narray/gen/tmpl/store.c
cumo-0.2.2 ext/cumo/narray/gen/tmpl/store.c
cumo-0.2.1 ext/cumo/narray/gen/tmpl/store.c
cumo-0.2.0 ext/cumo/narray/gen/tmpl/store.c
cumo-0.1.2 ext/cumo/narray/gen/tmpl/store.c
cumo-0.1.1 ext/cumo/narray/gen/tmpl/store.c