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.77.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.76.2 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.76.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.76.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.75.4 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.75.3 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.75.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.75.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.74.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.73.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.72.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.71.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.70.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.69.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.68.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.67.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.66.1 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.66.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.65.0 lib/pact_broker/client/matrix/formatter.rb
pact_broker-client-1.64.0 lib/pact_broker/client/matrix/formatter.rb