Class: NodeType

Inherits:
Object show all
Defined in:
ext/internal/node/node.c

Overview

NodeType is an abstraction for the C type of a node. It is a Struct which has two members, name and value.

Instance Method Summary collapse

Instance Method Details

#to_iNumeric

Returns an integer representing integer type of a node. This is the value you would see for the type of the node if you were examining it in gdb.

Returns:

  • (Numeric)


446
447
448
449
# File 'ext/internal/node/node.c', line 446

static VALUE node_type_to_i(VALUE node_type)
{
  return rb_struct_getmember(node_type, rb_intern("value"));
}

#nameString

Returns the name of the node.

Returns:

  • (String)


433
434
435
436
# File 'ext/internal/node/node.c', line 433

static VALUE node_type_to_s(VALUE node_type)
{
  return rb_struct_getmember(node_type, rb_intern("name"));
}