Class Lisp::Format::Directives::Directive
In: lib/facet/lisp-format.rb
Parent: Object

Base class for formatting directives. This class makes it easy for sub-classes to access the parameters and modifiers that were given to it when created.

Methods

arg_error   at_mod?   colon_mod?   execute   join   modifier?   new   param   param_error  

Attributes

pos  [R]  The position at which this directive occurs in the input string.

Public Class methods

Given a set of parameters, modifiers, an owning directive if available, and a position in the output string, create a new Directive.

Public Instance methods

This method should be overridden in sub-classes. It gets called when the directive is to be executed. It does nothing by default.

Join this directive with the following one, given in other. The default is to simply return other. The only known use for this is in SkipWhitespace, where some processing of other is done if it is a Literal.

Protected Instance methods

Check if the at (@) modifier was given.

Check if the colon (:) modifier was given.

Check if the given modifier was given. This method should not generally be called, as colon_mod? and at_mod? are easier and better to use.

Read the param:th parameter in the Lisp::Format::State state, using default as a default value if the parameter was not given.

[Validate]