| Class | PageTemplate::IfCommand |
| In: |
lib/PageTemplate/commands.rb
|
| Parent: | StackableCommand |
IfCommand is a StackableCommand. It requires an opening:
On execution, if variable is true, then the contents of IfCommand‘s @commands is printed.
objects are added to @falseCommands, and are printed if variable is false, instead.
Add the command to the @trueCommands or @falseCommands block, depending on if the command is an ‘if’ or ‘unless’ and if ‘else’ has been called.
an ‘else’ will modify the command, switching it from adding to @trueCommands to adding to @falseCommands, or vice versa.