Skip to content

struct Athena::Console::Loader::Factory
inherits Struct #

A default implementation of ACON::Loader::Interface that accepts a Hash(String, Proc(ACON::Command)).

A factory could then be set on the ACON::Application:

application = "My CLI"

application.command_loader ={
  "command1"        => Proc(ACON::Command).new { },
  "app:create-user" => Proc(ACON::Command).new { },

Included modules



.new(factories : Hash(String, Proc(ACON::Command)))#

View source


#get(name : String) : ACON::Command#

Returns an ACON::Command with the provided name. Raises ACON::Exceptions::CommandNotFound if it is not defined.

View source

#has?(name : String) : Bool#

Returns true if self has a command with the provided name, otherwise false.

View source

#names : Array(String)#

Returns all of the command names defined within self.

View source