W3cubDocs

/Padrino

Module: Padrino::Generators::Actions::ClassMethods

Overview

Class methods for Thor generators to support the generators and component choices.

Instance Method Summary

Instance Method Details

#available_choices_for(component) ⇒ Array<Symbol>

Returns the list of available choices for the given component (including none).

Examples:

available_choices_for :test
=> [:shoulda, :bacon, :minitest]

Parameters:

  • component (Symbol) — The type of the component module.

Returns:

  • (Array<Symbol>) — Array of component choices.

#component_option(name, caption, options = {}) ⇒ Object

Defines a class option to allow a component to be chosen and add to component type list. Also builds the available_choices hash of which component choices are supported.

Examples:

component_option :test, "Testing framework", :aliases => '-t', :choices => [:bacon, :shoulda]

Parameters:

  • name (Symbol) — Name of component.
  • caption (String) — Description of the component.
  • options (Hash) (defaults to: {}) — Additional parameters for component choice.

#component_types ⇒ Object

Returns the compiled list of component types which can be specified.

#defines_component_options(options = {}) ⇒ Object

Definitions for the available customizable components.

#require_arguments! ⇒ Object

Tell Padrino that for this Thor::Group it is a necessary task to run.

#require_arguments? ⇒ Boolean

Return true if we need an arguments for our Thor::Group.

Returns:

  • (Boolean)