Sha256: 3772efe524dc6300e72307f10ab5f0150ffc45eaf3b4d007c790fc13315b8c8f

Contents?: true

Size: 545 Bytes

Versions: 3

Compression:

Stored size: 545 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

3 entries across 3 versions & 1 rubygems

Version Path
alf-0.10.1 lib/alf/extra/yaml.rb
alf-0.10.0 lib/alf/extra/yaml.rb
alf-0.9.3 lib/alf/yaml.rb