View Source Filterable (Filterable v0.7.5)

Filterable allows to map incoming parameters to filter functions.

This module contains functions (apply_filters/3, filter_values/2) which allow to perform filtering and filterable macro which allows to define available filters using DSL (see Filterable.DSL).

Link to this section Summary

Link to this section Functions

Link to this function

apply!(queryable, params, module, opts \\ [])

View Source
@spec apply!(any(), map() | Keyword.t(), module(), Keyword.t()) :: any() | no_return()
Link to this function

apply_filters(queryable, params, module, opts \\ [])

View Source
@spec apply_filters(any(), map() | Keyword.t(), module(), Keyword.t()) ::
  {:ok, any(), map()} | {:error, String.t()}
Link to this function

apply_filters!(queryable, params, module, opts \\ [])

View Source
@spec apply_filters!(any(), map() | Keyword.t(), module(), Keyword.t()) ::
  {any(), map()} | no_return()
Link to this macro

define_module(module, list)

View Source (macro)
Link to this function

filter_values(params, module, opts \\ [])

View Source
@spec filter_values(map() | Keyword.t(), module(), Keyword.t()) ::
  {:ok, map()} | {:error, String.t()}
Link to this macro

filterable(arg, opts \\ [])

View Source (macro)