module Toys::Template::ClassMethods

Class methods that will be added to a template class.

Attributes

expansion[RW]

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.

@return [Proc] The expansion of this template.

Public Instance Methods

on_expand(&block) click to toggle source

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.

@param block [Proc] The expansion of this template. @return [self]

# File lib/toys/template.rb, line 106
def on_expand(&block)
  self.expansion = block
  self
end
Also aliased as: to_expand
to_expand(&block)
Alias for: on_expand