Module: Toys::Template::ClassMethods

Defined in:
core-docs/toys/template.rb

Overview

Defined in the toys-core gem

Class methods that will be added to a template class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expansionProc

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.

Returns:

  • (Proc)

    The expansion of this template.



109
110
111
# File 'core-docs/toys/template.rb', line 109

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.

Parameters:

  • block (Proc)

    The expansion of this template.

Returns:

  • (self)


97
98
99
# File 'core-docs/toys/template.rb', line 97

def on_expand(&block)
  # Source available in the toys-core gem
end