Component.new
Creates a new ComponentClass and registers it by name.
Creates a new ComponentClass and registers it by name.
Component("name", populate?) is equivalent to this function.
Populate receives the new component instance and :give / :ensure arguments.
component = Component.new( name, populate )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
name |
string | Unique name of the ComponentClass |
populate |
fun(component: Component, …): nil | Function that populates a Component with values |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
component |
ComponentClass |