module Eggshell::MacroHandler

Macros are extensible functions that can do a lot of things:

A typical macro call looks like this: `@macro(param, param, …)` and must be the first item on the line (excluding whitespace).

If a macro encloses a chunk of document, it would generally look like this:

pre. @block_macro(param, …) misc content misc content @end_block_macro

Constants

CHAIN_CONTINUE
CHAIN_END
CHAIN_NONE
CHAIN_START
COLLECT_NORMAL
COLLECT_RAW
COLLECT_RAW_MACRO

Public Instance Methods

chain_type(macro) click to toggle source

If a sequence of macros are related by conditional execution (if/elsif/else, for instance), this provides a hint to the processor in how to group and evaluate the macros.

@return Array In the form `[CHAIN_TYPE, MACRO_START]`

# File lib/eggshell/macro-handler.rb, line 46
def chain_type(macro)
        [CHAIN_NONE, nil]
end
collection_type(macro) click to toggle source

Indicates how to process lines contained with in the macro. {{COLLECT_NORMAL}} continues to evaluate block and macro content. {{COLLECT_RAW_MACRO}} collects all lines as raw unless a macro is encountered. {{COLLECT_RAW}} collects all lines as raw, regardless of nested macros. @todo needed?

# File lib/eggshell/macro-handler.rb, line 33
def collection_type(macro)
        COLLECT_NORMAL
end