Class: Ella::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/ella/generator.rb

Overview

This is an abstract class for the numerous generators that make up the bulk of this project. It cannot be run on its own. TODO: The first parameter should be part of the hash, for clarity.

Instance Method Summary collapse

Constructor Details

#initialize(directory: nil, files: [], templates: [], template_vars: {}) ⇒ Generator



8
9
10
11
12
13
# File 'lib/ella/generator.rb', line 8

def initialize(directory: nil, files: [], templates: [], template_vars: {})
  @directory = NameFormatter.new(directory) if directory
  @files = files
  @templates = templates
  @template_vars = template_vars
end

Instance Method Details

#runObject

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/ella/generator.rb', line 15

def run
  raise NotImplementedError, 'Subclasses must define \'run\'.'
end