Ambition::API

Your data store target (e.g. ActiveRecord) is extended or injected with this module.

Processors

These methods do not fire off a query and can be chained. They return a Context object which can be inspected or kicked.

Kickers

Kickers cause a query to execute. All method calls on a context are accumulated until kicked, at which point they’re turned into a query and run.

Custom Enumerables

These Enumerable methods are written special for Ambition. Other Enumerable methods, like each_with_index, should work out of the box as they mostly wrap each.

Translators and Query

Methods available to translator and Query instance methods:

Ambition::Adapters::YourAdapter::Select

All translators are instantiated and have access to owner and stash. They should not touch clauses directly.

The following methods are passed the left and right side of the expression they represent.

Ambition::Adapters::YourAdapter::Slice

All translators are instantiated and have access to owner and stash. They should not touch clauses directly.

The Slice translator has only one method: slice(start, length)

Some examples:

Ambition::Adapters::YourAdapter::Sort

All translators are instantiated and have access to owner and stash. They should not touch clauses directly.

Ambition::Adapters::YourAdapter::Query

The Query is instantiated and has access to owner, clauses, and stash. It should use the information these methods provide to build its domain specific query.

When any of the following methods are called on a Context they are forwarded to the Query instance.