Class: GSL::Object

Inherits:
Object
  • Object
show all
Defined in:
ext/gsl_native/gsl.c

Instance Method Summary collapse

Instance Method Details

#dupObject

#dup if desired.



58
59
60
61
62
# File 'ext/gsl_native/gsl.c', line 58

static VALUE rb_gsl_not_implemeted(VALUE obj)
{
  rb_raise(rb_eNotImpError, "%s#dup is not implemented", rb_class2name(CLASS_OF(obj)));
  return Qnil;
}

#infoObject



45
46
47
48
49
50
51
52
53
54
55
56
# File 'ext/gsl_native/gsl.c', line 45

static VALUE rb_gsl_object_info(VALUE obj)
{
  char buf[256];
  VALUE s;
  sprintf(buf, "Class:      %s\n", rb_class2name(CLASS_OF(obj)));
  sprintf(buf, "%sSuperClass: %s\n", buf, rb_class2name(RCLASS_SUPER(CLASS_OF(obj))));
  s = rb_rescue(rb_gsl_call_name, obj, rb_gsl_call_rescue, obj);
  if (s) sprintf(buf, "%sType:       %s\n", buf, STR2CSTR(s));
  s = rb_rescue(rb_gsl_call_size, obj, rb_gsl_call_rescue, obj);
  if (s) sprintf(buf, "%sSize:       %d\n", buf, (int) FIX2INT(s));
  return rb_str_new2(buf);
}

#inspectObject



23
24
25
26
27
28
# File 'ext/gsl_native/gsl.c', line 23

static VALUE rb_gsl_object_inspect(VALUE obj)
{
  char buf[256];
  sprintf(buf, "%s", rb_class2name(CLASS_OF(obj)));
  return rb_str_new2(buf);
}