struct

Noir::TreeSitterPythonRouteExtractor::Decoration

Inherits Struct < Value < Object

A @<router>.route(...) or @<router>.<method>(...) decorator, paired with the def/class it applies to.

Constructors

new(router_name : String, attribute_name : String, path : String, methods : Array(String), decorator_line : Int32, def_line : Int32, def_name : String, paths : Array(String) = [@path], keywords : Hash(String, String) = {} of String => String, rule_wrapper : String = "")
Source

Instance methods

attribute_name
Source
decorator_line
Source
def_line
Source
def_name
Source
keywords

Every keyword argument: string literals decoded, anything else as source text (auth="user" → "user", csrf=False → "False").

Source
methods
Source
path
Source
paths
Source
router_name
Source
rule_wrapper

The function a path came wrapped in (route(org_scoped_rule("/x")) → "org_scoped_rule"; path is "/x"), empty for a literal path. Only set when the caller asks for rule_wrappers: whether the wrapper serves its argument unchanged is for the caller to judge from the wrapper's definition.

Source