class

AzuCLI::Generate::Service

Inherits Teeplate::FileTree < Reference < Object

Service generator for business logic with CRUD actions

Constants

OUTPUT_DIR = "./src/services"

Constructors

new(name : String, action : String = "create", attributes : Hash(String, String) = {} of String => String)
Source

Instance methods

____collect_files(____files)

:nodoc:

Source
__ecr1(____io)
Source
__ecr3(____io)
Source
__ecr5(____io)
Source
__ecr7(____io)
Source
__ecr9(____io)
Source
action
Source
action=(action : String)
Source
attributes
Source
attributes=(attributes : Hash(String, String))
Source
camel_case_name
Source
constructor_params

Generate constructor parameters for model

Source
constructor_params_from_request

Generate constructor parameters from request object

Source
crystal_type(attr_type : String) : String

Get Crystal type for attribute

Source
full_module_name

Get the full nested module name for the service

Source
generate_create_service_content
Source
generate_destroy_service_content
Source
generate_index_service_content
Source
generate_result_concern(output_dir : String, force : Bool = false)

Helper method to generate Result concern directly

Source
generate_service_file(output_dir : String, force : Bool = false)

Helper method to generate service files directly

Source
generate_show_service_content
Source
generate_update_service_content
Source
id_type

Determine ID type based on database configuration or default to Int64

Source
model_class
Source
module_name
Source
module_name=(module_name : String)
Source
name
Source
name=(name : String)
Source
param_list

Generate parameter list from attributes

Source
render(output_dir : String, force : Bool = false, interactive : Bool = true, list : Bool = false, color : Bool = false)

Override render to generate one file per action + Result concern

Source
resource_plural
Source
resource_plural=(resource_plural : String)
Source
service_class_name
Source
snake_case_name
Source
snake_case_name=(snake_case_name : String)
Source
update_params

Generate update parameters hash

Source
update_params_from_request

Generate update parameters hash from request object

Source