Skip to content

class Athena::Console::Helper::HelperSet
inherits Reference #

The container that stores various ACON::Helper::Interface implementations, keyed by their class.

Each application includes a default helper set, but additional ones may be added. See ACON::Application#helper_set.

These helpers can be accessed from within a command via the ACON::Command#helper method.

Constructors#

.new(helpers : Hash(ACON::Helper.class, ACON::Helper::Interface) = Hash(ACON::Helper.class, ACON::Helper::Interface).new)#

View source

.new(*helpers : ACON::Helper::Interface) : self#

View source

Methods#

#<<(helper : ACON::Helper::Interface) : Nil#

Adds the provided helper to self.

View source

#[](helper_class : T.class) : T forall T#

Returns the helper of the provided helper_class, or raises if it is not defined.

View source

#[]?(helper_class : T.class) : T | Nil forall T#

Returns the helper of the provided helper_class, or nil if it is not defined.

View source

#has?(helper_class : ACON::Helper.class) : Bool#

Returns true if self has a helper for the provided helper_class, otherwise false.

View source