class

AzuCLI::Generate::Endpoint

Inherits Reference < Object

Endpoint generator that creates Azu::Endpoint structs

Constants

OUTPUT_DIR = "./src/endpoints"

Constructors

new(name : String, actions : Array(String) = [] of String, endpoint_type : String = "api", scaffold : Bool = false, module_name : String | Nil = nil)
Source

Instance methods

action
Source
action=(action : String)
Source
action_path(action : String) : String

Get path for action

Source
actions
Source
actions=(actions : Array(String))
Source
effective_actions

Get actions to use (actions are always required)

Source
endpoint_struct_name

Convert name to endpoint struct name (nested under resource module)

Source
endpoint_type
Source
endpoint_type=(endpoint_type : String)
Source
fields
Source
fields=(fields : Hash(String, String))
Source
full_path(action : String) : String

Get full path for action

Source
has_actions?

Check if endpoint has actions

Source
http_verb(action : String) : String

Get HTTP verb for action

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

Override render to create one file per action

Source
request_type

Get the request/response types based on endpoint type (nested under resource module)

Source
resource_plural
Source
resource_plural=(resource_plural : String)
Source
resource_singular
Source
resource_singular=(resource_singular : String)
Source
response_type
Source
scaffold
Source
scaffold=(scaffold : Bool)
Source
scaffold_components

Get scaffold components to generate

Source
snake_case_name
Source
snake_case_name=(snake_case_name : String)
Source