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? }
[View source]

1273
1274
1275
1276
1277
1278
1279
1280
# File 'ext/oj/fast.c', line 1273

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;
}