class
AzuCLI::Generate::Endpoint
- AzuCLI::Generate::Endpoint
- Reference
- Object
Overview
Endpoint generator that creates Azu::Endpoint structs
Defined in:
azu_cli/generators/endpoint.crConstant Summary
-
OUTPUT_DIR =
"./src/endpoints"
Constructors
Instance Method Summary
- #action : String
- #action=(action : String)
-
#action_path(action : String) : String
Get path for action
- #actions : Array(String)
- #actions=(actions : Array(String))
-
#effective_actions : Array(String)
Get actions to use (actions are always required)
-
#endpoint_struct_name : String
Convert name to endpoint struct name (nested under resource module)
- #endpoint_type : String
- #endpoint_type=(endpoint_type : String)
- #fields : Hash(String, String)
- #fields=(fields : Hash(String, String))
-
#full_path(action : String) : String
Get full path for action
-
#has_actions? : Bool
Check if endpoint has actions
-
#http_verb(action : String) : String
Get HTTP verb for action
- #module_name : String
- #module_name=(module_name : String)
- #name : String
- #name=(name : String)
-
#render(output_dir : String, force : Bool = false, interactive : Bool = true, list : Bool = false, color : Bool = false)
Override render to create one file per action
-
#request_type : String
Get the request/response types based on endpoint type (nested under resource module)
- #resource_plural : String
- #resource_plural=(resource_plural : String)
- #resource_singular : String
- #resource_singular=(resource_singular : String)
- #response_type : String
- #scaffold : Bool
- #scaffold=(scaffold : Bool)
-
#scaffold_components : Array(String)
Get scaffold components to generate
- #snake_case_name : String
- #snake_case_name=(snake_case_name : String)
Constructor Detail
def self.new(name : String, actions : Array(String) = [] of String, endpoint_type : String = "api", scaffold : Bool = false, module_name : String | Nil = nil)
#
Instance Method Detail
def endpoint_struct_name : String
#
Convert name to endpoint struct name (nested under resource module)
def render(output_dir : String, force : Bool = false, interactive : Bool = true, list : Bool = false, color : Bool = false)
#
Override render to create one file per action
def request_type : String
#
Get the request/response types based on endpoint type (nested under resource module)