class Pegasus::Generators::Api::FileGenerator(C, I)

Overview

A base class for a source file generator. This class is meant to be extended by each individual file generator that uses ECR, and thus provides the methods #input! and #context to make the genertor's input and context available inside the template file.

Direct Known Subclasses

Defined in:

generators/generators.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(parent : Pegasus::Generators::Api::PegasusOptionParser(C, I), name : String, default_filename : String, description : String) #

Creates a new file generator attached to he given PegasusOptionParser, with the given name, default filename, and description.


[View source]

Instance Method Detail

def add_option(opt_parser) #

Adds required options to the given option parser.


[View source]
def context #

Convenience method to access the parser context from an ECR template.


[View source]
def default_filename : String #

The default filename this generator will write to.


[View source]
def default_filename=(default_filename : String) #

The default filename this generator will write to.


[View source]
def description : String #

The user-friendly description of this generator.


[View source]
def description=(description : String) #

The user-friendly description of this generator.


[View source]
def input! #

Convenience method to access the parser generator input from an ECR template.


[View source]
def name : String #

The internal name of this file generator, which will be associated with a filename by the PegasusOptionParser.


[View source]
def name=(name : String) #

The internal name of this file generator, which will be associated with a filename by the PegasusOptionParser.


[View source]
def parent : PegasusOptionParser(C, I) #

The parser program to which this generator belongs, used to retreive input and context and to configure and retreive file names.


[View source]
def parent=(parent : PegasusOptionParser(C, I)) #

The parser program to which this generator belongs, used to retreive input and context and to configure and retreive file names.


[View source]