Class: Rubydex::UnresolvedConstantReference

Inherits:
ConstantReference show all
Defined in:
ext/rubydex/reference.c

Instance Method Summary collapse

Methods inherited from ConstantReference

#initialize, #location

Methods inherited from Reference

#initialize

Constructor Details

This class inherits a constructor from Rubydex::ConstantReference

Instance Method Details

#nameObject

ConstantReference#name -> String



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'ext/rubydex/reference.c', line 15

static VALUE rdxr_constant_reference_name(VALUE self) {
    HandleData *data;
    TypedData_Get_Struct(self, HandleData, &handle_type, data);

    void *graph;
    TypedData_Get_Struct(data->graph_obj, void *, &graph_type, graph);

    const char *name = rdx_constant_reference_name(graph, data->id);
    if (name == NULL) {
        return Qnil;
    }

    VALUE str = rb_utf8_str_new_cstr(name);
    free_c_string(name);
    return str;
}