Sha256: 7f65f3504e7fcf615daef9c6ac0134027fd28bb5150a658b2e654621c97671a8

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

module Alf
  module YAML
    #
    # Implements Alf::Renderer contract for outputing YAML files.
    #
    class Renderer < ::Alf::Renderer

      protected 

      # (see Alf::Renderer#render)
      def render(input, output)
         require "yaml"
        # TODO: refactor this to avoid loading all tuples
        # in memory
        output << input.to_a.to_yaml << "\n"
        output
      end

      Alf::Renderer.register(:yaml, "as a yaml output",  self)
    end # class Renderer
  end # module YAML
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-0.12.2 lib/alf-yaml/alf/yaml/renderer.rb
alf-0.12.1 lib/alf-yaml/alf/yaml/renderer.rb
alf-0.12.0 lib/alf-yaml/alf/yaml/renderer.rb
alf-0.11.1 lib/alf-yaml/alf/yaml/renderer.rb
alf-0.11.0 lib/alf-yaml/alf/yaml/renderer.rb