Class: Usamin::Value

Inherits:
Object
  • Object
show all
Defined in:
ext/usamin/usamin.cpp

Direct Known Subclasses

Array, Hash

Instance Method Summary collapse

Instance Method Details

#array?Boolean

Returns whether the value is array.

Returns:

  • (Boolean)


521
522
523
524
525
# File 'ext/usamin/usamin.cpp', line 521

static VALUE w_value_isarray(const VALUE self) {
    UsaminValue *value = get_value(self);
    check_value(value);
    return value->value->IsArray() ? Qtrue : Qfalse;
}

#evalObject

Convert to Ruby data structures.

Returns:

  • (Object)


541
542
543
544
545
546
547
548
549
550
# File 'ext/usamin/usamin.cpp', line 541

static VALUE w_value_eval(const VALUE self) {
    UsaminValue *value = get_value(self);
    check_value(value);
    if (value->value->IsObject())
        return eval_object(*(value->value), value->root_document);
    else if (value->value->IsArray())
        return eval_array(*(value->value), value->root_document);
    else
        return Qnil;
}

#eval_rObject

Convert to Ruby data structures recursively.

Returns:

  • (Object)


557
558
559
560
561
# File 'ext/usamin/usamin.cpp', line 557

static VALUE w_value_eval_r(const VALUE self) {
    UsaminValue *value = get_value(self);
    check_value(value);
    return eval_r(*(value->value));
}

#frozen?Boolean

Always true.

Returns:

  • (Boolean)


566
567
568
# File 'ext/usamin/usamin.cpp', line 566

static VALUE w_value_isfrozen(const VALUE self) {
    return Qtrue;
}

#hash?Boolean

Returns whether the value is object.

Returns:

  • (Boolean)


530
531
532
533
534
# File 'ext/usamin/usamin.cpp', line 530

static VALUE w_value_isobject(const VALUE self) {
    UsaminValue *value = get_value(self);
    check_value(value);
    return value->value->IsObject() ? Qtrue : Qfalse;
}

#object?Boolean

Returns whether the value is object.

Returns:

  • (Boolean)


530
531
532
533
534
# File 'ext/usamin/usamin.cpp', line 530

static VALUE w_value_isobject(const VALUE self) {
    UsaminValue *value = get_value(self);
    check_value(value);
    return value->value->IsObject() ? Qtrue : Qfalse;
}

#rootUsaminValue

Returns root object.

Returns:

  • (UsaminValue)


575
576
577
578
579
# File 'ext/usamin/usamin.cpp', line 575

static VALUE w_value_root(const VALUE self) {
    UsaminValue *value = get_value(self);
    check_value(value);
    return value->root_document;
}