Method: Oj::Doc#exists?
- Defined in:
- ext/oj/fast.c
permalink #exists?(path) ⇒ Boolean
Returns true if the value at the location identified by the path exists.
@param [String] path path to the location
1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 |
# File 'ext/oj/fast.c', line 1358
static VALUE doc_exists(VALUE self, VALUE str) {
Doc doc;
Leaf leaf;
doc = self_doc(self);
if (0 != (leaf = get_doc_leaf(doc, StringValuePtr(str)))) {
if (NULL != leaf) {
return Qtrue;
}
}
return Qfalse;
}
|