Module: Eggshell::MacroHandler
- Includes:
- BaseHandler, ProcessHandler
- Included in:
- Bundles::Basic::ControlLoopMacros, Bundles::Basic::CoreMacros, Bundles::Basics::BasicMacros, Bundles::Basics::ControlMacros, Bundles::Basics::InlineMacros, Bundles::Loader::LoaderMacro, Defaults::NoOpHandler
- Defined in:
- lib/eggshell/macro-handler.rb
Overview
Macros are extensible functions that can do a lot of things:
-
include other Eggshell documents into current document
-
process part of a document into a variable
-
do conditional processing
-
do loop processing
-
etc.
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
Defined Under Namespace
Modules: Defaults
Constant Summary collapse
- COLLECT_NORMAL =
:collect_normal
- COLLECT_RAW_MACRO =
:collect_raw_macro
- COLLECT_RAW =
:collect_raw
Instance Method Summary collapse
-
#collection_type(macro) ⇒ Object
Indicates how to process lines contained with in the macro.
Methods included from ProcessHandler
Methods included from BaseHandler
Instance Method Details
#collection_type(macro) ⇒ Object
needed?
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.
34 35 36 |
# File 'lib/eggshell/macro-handler.rb', line 34 def collection_type(macro) COLLECT_NORMAL end |