Class: Coradoc::Mirror::Output::MirrorYaml

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/mirror/output.rb

Overview

YAML output processor for the Coradoc::Output pipeline.

Class Method Summary collapse

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, _options = {})
  input.each_with_object({}) do |(filename, document), result|
    node = Coradoc::Mirror.transform(document)
    result[filename] = YAML.dump(node.to_hash)
  end
end

.processor_idObject



38
39
40
# File 'lib/coradoc/mirror/output.rb', line 38

def processor_id
  :mirror_yaml
end

.processor_match?(filename) ⇒ Boolean

Returns:

  • (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