NAME
Articulate::Flow::MetaSwitch - case switching on metadata
CONFIGURATION
- class: Articulate::Flow::MetaSwitch
args:
field: schema/core/content_type
where:
'text/markdown':
- Articulate::Enrichment::Markdown
otherwise:
- SomeOther::Enrichment
- class: Articulate::Flow::MetaSwitch
args:
where:
- field: schema/core/file
then:
- Handle::File
otherwise:
- Assuming::Text
DESCRIPTION
This provides a convenient interface to a common branching pattern. When performing actions like enrich
and augment
, a developer will typically want to make some processes dependant on the metadata of that content.
Rather than having to write a 'black box' provider every time, this class provides a standard way of doing it.
METHODS
enrich
$self->enrich( $item, $request );
$self->process_method( enrich => $item, $request );
augment
$self->augment( $item, $request );
$self->process_method( augment => $item, $request );
process_method
$self->process_method( $verb, $item, $request );