Class PageTemplate::CaseCommand
In: lib/PageTemplate/case.rb
Parent: StackableCommand

CaseCommand provides switch-command functionality. [% case variable %] [% when literal1 %] [% when literal2 %] [% when literal3 %] [% else %] [% end %]

Methods

add   else   new   output   to_s   when  

Attributes

current_case  [R] 

Public Class methods

command is a variable that is evaluated against the namespace on execution, and then tested against the literals of when. It must return a string literal.

Public Instance methods

Adds a command to the current case, or to the ‘else

If namespace.get(@value) exists in the ‘when’ clauses, then print out that block.

when’ and ‘else’ modify this command.

[Validate]