class

Analyzer::Rust::Gotham

Inherits Analyzer::Rust::RustEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Gotham analyzer (tree-sitter port). Gotham wires routes with a builder chain that pairs each verb call with a following .to:

Router::builder()
    .get("/users/:id").to(user_handler)
    .post("/users").to(create_user_handler)

The analyzer walks call_expression nodes whose function is a field_expression named to — the receiver of .to(handler) is the .<verb>("/path") call, so each routing entry has both pieces locally and we don't need to thread state through the chain.

Constants

HTTP_VERBS = Set {"get", "post", "put", "delete", "patch", "head", "options"}
TERMINAL_NAMES = Set {"to", "to_file", "to_dir", "to_new_handler", "to_async_borrowing"}

Route terminals: .to(handler) binds a handler fn; .to_file / .to_dir / .to_new_handler bind static/dynamic handlers (no fn name, but still a real route).

Class methods

tech_name
Source

Instance methods

analyze_file(path : String) : Array(Endpoint)
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source