Sha256: 3bfa6c5756c31e26c4a9b4a153d03d95d0d1a9d78c43d46d33756954e50fc1e6

Contents?: true

Size: 564 Bytes

Versions: 119

Compression:

Stored size: 564 Bytes

Contents

require 'pact_broker/client/matrix/json_formatter'
require 'pact_broker/client/matrix/text_formatter'

module PactBroker
  module Client
    class Matrix
      class Formatter
        def self.call(matrix_lines, format)
          formatter = case format
          when 'json' then JsonFormatter
          when 'table' then TextFormatter
          else
            raise PactBroker::Client::Error.new("Invalid output option '#{format}. Must be one of 'table' or 'json'.")
          end
          formatter.call(matrix_lines)
        end
      end
    end
  end
end

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
pact_broker-client-1.20.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.19.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.18.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.17.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.16.2 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.16.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.16.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.15.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.15.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.14.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.14.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.13.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.13.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.12.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.11.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.10.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.9.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.8.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.7.0 lib/pact_broker/client/matrix/formatter.rb