Class: Coradoc::Mirror::Output::MirrorYaml
- Inherits:
-
Object
- Object
- Coradoc::Mirror::Output::MirrorYaml
- Defined in:
- lib/coradoc/mirror/output.rb
Overview
YAML output processor for the Coradoc::Output pipeline.
Class Method Summary collapse
- .processor_execute(input, _options = {}) ⇒ Object
- .processor_id ⇒ Object
- .processor_match?(filename) ⇒ Boolean
Class Method Details
.processor_execute(input, _options = {}) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/coradoc/mirror/output.rb', line 46 def processor_execute(input, = {}) input.each_with_object({}) do |(filename, document), result| node = Coradoc::Mirror.transform(document) result[filename] = YAML.dump(node.to_hash) end end |
.processor_id ⇒ Object
38 39 40 |
# File 'lib/coradoc/mirror/output.rb', line 38 def processor_id :mirror_yaml end |
.processor_match?(filename) ⇒ Boolean
42 43 44 |
# File 'lib/coradoc/mirror/output.rb', line 42 def processor_match?(filename) filename.downcase.end_with?('.mirror.yaml', '.mirror.yml') end |