abstract class Pegasus::Generators::Api::FileInput(I)

Overview

Input method that reads from a file, the name of which is specified on the command line.

Direct Known Subclasses

Defined in:

generators/generators.cr

Constructors

Instance Method Summary

Instance methods inherited from class Pegasus::Generators::Api::Input(I)

add_option(opt_parser) add_option, process(opt_parser) : I process

Constructor Detail

def self.new(name : String, description : String) #

Create a new file input with the given internal name and user-friendly description.


[View source]

Instance Method Detail

def add_option(opt_parser) #
Description copied from class Pegasus::Generators::Api::Input(I)

Register this input method's options with the given PegasusOptionParser.


[View source]
def description : String #

The user-friendly description of the input that will be shown on the help screen.


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

The user-friendly description of the input that will be shown on the help screen.


[View source]
def filename : String | Nil #

The name of the file to read from.


[View source]
def filename=(filename : String | Nil) #

The name of the file to read from.


[View source]
def name : String #

The internal name of this input. The PegasusOptionParser will associated a file name with this string.


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

The internal name of this input. The PegasusOptionParser will associated a file name with this string.


[View source]
abstract def process(opt_parser, file) : I #

Read a value of type I from a file.


[View source]
def process(opt_parser) : I #
Description copied from class Pegasus::Generators::Api::Input(I)

Read input of type I.


[View source]