class AzuCLI::Generate::Validator

Overview

Validator generator that creates Azu::Validator classes

Defined in:

azu_cli/generators/validator.cr

Constant Summary

OUTPUT_DIR = "./src/validators"

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, record_type : String = "User", validation_rules : Array(String) = [] of 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 class_name : String #

Convert name to validator class name


[View source]
def common_validations : String #

Get common validation patterns


[View source]
def has_validation_rules? : Bool #

Check if validator has validation rules


[View source]
def name : String #

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

[View source]
def record_type : String #

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

[View source]
def snake_case_name : String #

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

[View source]
def validation_logic : String #

Get validation logic based on rules


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

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

[View source]
def validation_rules_comments : String #

Get validation rules as comments


[View source]