struct

QueryPattern

Inherits Struct < Value < Object

This checks if any field in a collection of fields matches a pattern. It is used in query loaders and response filters to match request parameters with a pattern to determine which items should appear in API responses.

A pattern is always two parts; a resource and an attribute separated by a dot (.). Eg: user.name, bearer_login.name, login.*.

IDs and foreign keys are always skipped because they are always already included in responses. Patterns that end with ".*" are wildcards.

Constructors

new(pattern : String)
Source

Class methods

match?(pattern, fields)
Source

Instance methods

match?(fields : Indexable(String) | Nil) : Bool | Nil
Source
match?(*fields : String)
Source