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.63.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.62.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.62.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.61.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.61.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.60.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.59.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.58.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.57.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.56.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.55.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.54.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.53.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.52.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.51.2 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.51.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.51.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.50.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.49.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.48.0 lib/pact_broker/client/matrix/formatter.rb