Sha256: 90b88854706c9c681eaa7bd9f06b56ae1732728c94e0e3dc78eddd4d21372978

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

# coding: utf-8

module ThinReports

  module Generator
    # @param [Symbol] type
    # @param report (see ThinReports::Generator::Base#initialize)
    # @param options (see ThinReports::Generator::Base#initialize)
    def self.new(type, report, options = {})
      unless generator = registry[type]
        raise ThinReports::Errors::UnknownGeneratorType
      end
      generator.new(report, options)
    end
    
    # @private
    def self.register(type, generator)
      registry[type] = generator
    end
    
    # @private
    def self.registry
      @generators ||= {}
    end
  end
end

require 'thinreports/generator/base'
require 'thinreports/generator/pxd'
require 'thinreports/generator/pdf'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.6.0.pre3 lib/thinreports/generator.rb