Class: Templater::Actions::Template

Class | Templater::Actions::Template
In: | lib/templater/actions/template.rb
Parent: | Action

### Methods

exists? identical? invoke! new render revoke!

### Public Class methods

new(generator, name, source, destination, options={})

Builds a new template.

### Parameters

generator<Object>: | Context for rendering
name<Symbol>: | The name of this template
source<String>: | Full path to the source of this template
destination<String>: | Full path to the destination of this template
options<Hash{Symbol=>Symbol}: | Options, including callbacks.

### Public Instance methods

exists?()

Checks if the destination file already exists.

### Returns

Boolean: | true if the file exists, false otherwise.

identical?()

Checks if the content of the file at the destination is identical to the rendered result.

### Returns

Boolean: | true if it is identical, false otherwise.

invoke!()

Renders the template and copies it to the destination.

render()

Renders the template using ERB and returns the result as a String.

### Returns

String: | The rendered template.

revoke!()

removes the destination file

[Validate]