Method: Oj::Doc#home

Defined in:
ext/oj/fast.c

#homeObject

Moves the document marker or location to the hoot or home position. The same operation can be performed with a Oj::Doc.move(‘/’).

Examples:

Oj::Doc.open('[1,2,3]') { |doc| doc.move('/2'); doc.home(); doc.where? }  #=> '/'


1298
1299
1300
1301
1302
1303
1304
1305
1306
# File 'ext/oj/fast.c', line 1298

static VALUE
doc_home(VALUE self) {
    Doc	doc = self_doc(self);

    *doc->where_path = doc->data;
    doc->where = doc->where_path;

    return oj_slash_string;
}