Pacer extensions allow you to extend vertices and routes with your own Ruby methods.
If routes are what makes Pacer fast, then extensions are what makes it powerful.
How do they work?
Define an extension
self.out_e.in_v # self is a vertex object
self.first.out_e.in_v # self is a route object
# The route g.v is extended with MyExtension
# Since g.v is a route, it is extended with Route methods
# A single vertex is extended with Vertex methods
What are they good for?
Pacer extensions allow you to extend Pacer with your domain specific language.
They abstract away the details of the underlying graph, and let you build more interesting traversals (i.e. answer more interesting questions).
For example, you can write extensions that will allow you to query a flights database as follows:
g.v(Airport, airport: 'LGA').flights_to('LAX').non_stop.morning.on('2015-3-4')
Or, search for potential new followers for your tweeter account as follows:
# Look at my tweets, then the users who retweeted them, but only those who are not already following me
The traversal above can be defined as a Vertex method in the extension. This will allow us to do:
# Much simpler ...
# Chain it with other traversals to build complex traversals