struct Launch::Controller::FilterBuilder

Overview

Builds a BeforeAction filter.

The yielded object has an #only method that accepts two arguments, a key (Symbol) and a block ->Nil.

FilterChainBuilder.build do |b|
  filter :index, :show { some_method }
  filter :delete { }
end

Defined in:

launch/controller/filters.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

blank? blank?, present? present?

Constructor Detail

def self.new(filters : Filters, precedence : Symbol) #

[View source]

Instance Method Detail

def add(action, &block : -> Nil) #

[View source]
def all(&block : -> Nil) #

[View source]
def clone #

[View source]
def copy_with(filters _filters = @filters, precedence _precedence = @precedence) #

[View source]
def except(action : Symbol, &block : -> Nil) #

[View source]
def except(actions : Array(Symbol), &block : -> Nil) #

[View source]
def filters : Filters #

def only(action : Symbol, &block : -> Nil) #

[View source]
def only(actions : Array(Symbol), &block : -> Nil) #

[View source]
def precedence : Symbol #