Module: Toys::Template::ClassMethods
- Defined in:
- toys-core/lib/toys/template.rb
Overview
Defined in the toys-core gem
Class methods that will be added to a template class.
Instance Attribute Summary collapse
-
#expansion ⇒ Proc
The template expansion proc.
Instance Method Summary collapse
-
#on_expand(&block) ⇒ self
(also: #to_expand)
Define how to expand this template.
Instance Attribute Details
#expansion ⇒ Proc
The template expansion proc. This proc is passed the template object, and is evaluted in the tool class. It should invoke directives to create tools and other objects.
123 124 125 |
# File 'toys-core/lib/toys/template.rb', line 123 def expansion @expansion end |
Instance Method Details
#on_expand(&block) ⇒ self Also known as: to_expand
Define how to expand this template. The given block is passed the template object, and is evaluated in the tool class. It should invoke directives to create tools and other objects.
110 111 112 113 |
# File 'toys-core/lib/toys/template.rb', line 110 def (&block) self.expansion = block self end |