Sha256: ae8a860339bf762181becddb998c2bd570c986f35788c4ced16566b3651cc31f

Contents?: true

Size: 729 Bytes

Versions: 10

Compression:

Stored size: 729 Bytes

Contents

require 'approvals/writers/text_writer'
require 'approvals/writers/array_writer'
require 'approvals/writers/hash_writer'
require 'approvals/writers/html_writer'
require 'approvals/writers/xml_writer'
require 'approvals/writers/json_writer'
require 'approvals/writers/binary_writer'

module Approvals
  module Writer
    extend Writers

    REGISTRY = {
      json: Writers::JsonWriter.new,
      xml: Writers::XmlWriter.new,
      html: Writers::HtmlWriter.new,
      hash: Writers::HashWriter.new,
      array: Writers::ArrayWriter.new,
    }


    class << self
      def for(format)
        if REGISTRY.include?(format)
          REGISTRY[format]
        else
          TextWriter.new
        end
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
approvals-0.0.22 lib/approvals/writer.rb
approvals-0.0.21 lib/approvals/writer.rb
approvals-0.0.20 lib/approvals/writer.rb
approvals-0.0.19 lib/approvals/writer.rb
approvals-0.0.18 lib/approvals/writer.rb
approvals-0.0.17 lib/approvals/writer.rb
approvals-0.0.16 lib/approvals/writer.rb
approvals-0.0.15 lib/approvals/writer.rb
approvals-0.0.14 lib/approvals/writer.rb
approvals-0.0.13 lib/approvals/writer.rb