class AzuCLI::Generate::Middleware

Overview

Middleware generator that creates HTTP::Handler classes

Defined in:

azu_cli/generators/middleware.cr

Constant Summary

OUTPUT_DIR = "./src/middleware"

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, middleware_type : String = "authentication", skip_paths : Array(String) = [] of String, context_vars : Hash(String, String) = {} of String => String) #

[View source]

Instance Method Detail

def ____collect_files(____files) #
Description copied from class Teeplate::FileTree

:nodoc:


[View source]
def __ecr0(____io) #

[View source]
def context_vars : Hash(String, String) #

[View source]
def context_vars=(context_vars : Hash(String, String)) #

[View source]
def context_vars_string : String #

Get context variables string


[View source]
def crystal_type(var_type : String) : String #

Get Crystal type for context variable


[View source]
def default_skip_paths : Array(String) #

Get default skip paths based on middleware type


[View source]
def get_skip_paths : Array(String) #

Get skip paths (use provided or defaults)


[View source]
def has_context_vars? : Bool #

Check if middleware has context variables


[View source]
def middleware_class_name : String #

Convert name to middleware class name


[View source]
def middleware_logic : String #

Get middleware type specific logic


[View source]
def middleware_type : String #

[View source]
def middleware_type=(middleware_type : String) #

[View source]
def name : String #

[View source]
def name=(name : String) #

[View source]
def private_methods : String #

Get private methods based on middleware type


[View source]
def skip_paths : Array(String) #

[View source]
def skip_paths=(skip_paths : Array(String)) #

[View source]
def snake_case_name : String #

[View source]
def snake_case_name=(snake_case_name : String) #

[View source]