Sha256: 9d5bf8cdc6ea7740bddb6fa03ee0beef3020e6108bb602898622f4200d186874

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

module Alf
  #
  # Renders a relation (given by any Iterator) in a specific format.
  #
  # A renderer takes an Iterator instance as input and renders it on an output
  # stream. Renderers are **not** iterators themselves. Their usage is made 
  # via their {#execute} method.
  #
  # Similarly to the {Reader} class, this one provides a registration mechanism
  # for specific output formats. The common scenario is as follows:
  #
  #   # Register a new renderer for :foo format (automatically provides the 
  #   # '--foo   Render output as a foo stream' option of 'alf show') and with
  #   # the FooRenderer class for handling rendering.  
  #   Renderer.register(:foo, "as a foo stream", FooRenderer)
  #
  #   # Later on, you can request a renderer instance for a specific format
  #   # as follows (wiring input is optional) 
  #   r = Renderer.renderer(:foo, [an Iterator])
  #
  #   # Also, a factory method is automatically installed on the Renderer class
  #   # itself.
  #   r = Renderer.foo([an Iterator])
  #
  class Renderer
    require 'alf/renderer/class_methods'
    require 'alf/renderer/instance_methods'
    require 'alf/renderer/rash'
    require 'alf/renderer/text'

  end # class Renderer
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

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