Ruby API

The prism gem provides a Ruby API for accessing the syntax tree.

For the most part, the API for accessing the tree mirrors that found in the Syntax Tree project. This means:

Every entry in config.yml will generate a Ruby class as well as the code that builds the nodes themselves. Creating a syntax tree involves calling one of the class methods on the Prism module. The full API is documented below.

API

Nodes

Once you have nodes in hand coming out of a parse result, there are a number of common APIs that are available on each instance. They are: