Method: StringIO#pos=

Defined in:
ext/stringio/stringio.c

#pos=(new_position) ⇒ Object

Sets the current position (in bytes); see Position.



748
749
750
751
752
753
754
755
756
757
758
# File 'ext/stringio/stringio.c', line 748

static VALUE
strio_set_pos(VALUE self, VALUE pos)
{
    struct StringIO *ptr = StringIO(self);
    long p = NUM2LONG(pos);
    if (p < 0) {
	error_inval(0);
    }
    ptr->pos = p;
    return pos;
}