Class: Rubydex::ConstantReference
- Defined in:
- ext/rubydex/reference.c
Direct Known Subclasses
Instance Method Summary collapse
-
#document ⇒ Rubydex::Document
Returns the document this constant reference belongs to.
- #initialize ⇒ Object constructor
-
#location ⇒ Rubydex::Location
Returns the source location for this constant reference.
Constructor Details
#initialize ⇒ Object
Instance Method Details
#document ⇒ Rubydex::Document
Returns the document this constant reference belongs to.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'ext/rubydex/reference.c', line 64 static VALUE rdxr_constant_reference_document(VALUE self) { HandleData *data; void *graph = rdxi_graph_from_handle(self, &data); const uint64_t *uri_id = rdx_constant_reference_document(graph, data->id); if (uri_id == NULL) { rb_raise(rb_eRuntimeError, "Constant reference not found"); } VALUE argv[] = {data->graph_obj, ULL2NUM(*uri_id)}; free_u64(uri_id); return rb_class_new_instance(2, argv, cDocument); } |
#location ⇒ Rubydex::Location
Returns the source location for this constant reference.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'ext/rubydex/reference.c', line 45 static VALUE rdxr_constant_reference_location(VALUE self) { HandleData *data; void *graph = rdxi_graph_from_handle(self, &data); Location *loc = rdx_constant_reference_location(graph, data->id); if (loc == NULL) { rb_raise(rb_eRuntimeError, "Constant reference must exist for a valid id"); } VALUE location = rdxi_build_location_value(loc); rdx_location_free(loc); return location; } |