| 1 |
#include "ruby/ruby.h" |
| 2 |
|
| 3 |
static VALUE |
| 4 |
arith_seq_s_beg_len_step(VALUE mod, VALUE obj, VALUE len, VALUE err) |
| 5 |
{ |
| 6 |
VALUE r; |
| 7 |
long beg, len2, step; |
| 8 |
|
| 9 |
r = rb_arithmetic_sequence_beg_len_step(obj, &beg, &len2, &step, NUM2LONG(len), NUM2INT(err)); |
| 10 |
|
| 11 |
return rb_ary_new_from_args(4, r, LONG2NUM(beg), LONG2NUM(len2), LONG2NUM(step)); |
| 12 |
} |
| 13 |
|
| 14 |
void |
| 15 |
Init_beg_len_step(void) |
| 16 |
{ |
| 17 |
VALUE cArithSeq = rb_path2class("Enumerator::ArithmeticSequence"); |
| 18 |
rb_define_singleton_method(cArithSeq, "__beg_len_step__", arith_seq_s_beg_len_step, 3); |
| 19 |
} |