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

Super-class for ‘printing’ directives, namely ~A (Ascii) and ~S (SExpression). These directives print, in some sense, their argument in a Ruby friendly manner. This means that their argument is either converted to a string using Object#to_s or Object#inspect.

Methods

execute   new  

Public Class methods

All parameters except inspect are simply passed on to Directive#initialize. If inspect is true, string arguments are inspected as well as all other objects.

Public Instance methods

Output the given argument as it generally prints in Ruby. The full form is:

  ~mincol,colinc,minpad,padchar:@[AS]

with the following interpretations

mincol (0)
minimum number of columns to output,
colinc (1)
number of columns to increase by, until mincol is reached,
minpad (0)
minimum amount of padding to add (added before mincol is checked),
padchar (?\s)
character to pad with,
:
nil is output as nil (In Lisp, this outputs nil as (), which isn’t generally useful in Ruby. TODO: come up with better use for this modifier),
@
padding is done on the right.

[Validate]