Sha256: 77862c9eb36e8f2a6910616b59c38b8f79537b1c65fbfed787eb25253cdccfea

Contents?: true

Size: 808 Bytes

Versions: 10

Compression:

Stored size: 808 Bytes

Contents

# frozen_string_literal: true

require 'terminal-table'

module CycloneLariat
  module Presenters
    class Queues
      HEADS = %w[valid region account_id name instance kind publisher type destination fifo].freeze

      def self.call(queues)
        new.call(queues)
      end

      def call(queues)
        rows = []
        queues.each do |queue|
          rows << row(queue)
        end

        Terminal::Table.new rows: rows, headings: HEADS
      end

      private

      def row(queue)
        [
          queue.custom? ? 'custom' : 'standard',
          queue.region,
          queue.account_id,
          queue.name,
          queue.instance,
          queue.kind,
          queue.publisher,
          queue.type,
          queue.dest,
          queue.fifo
        ]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cyclone_lariat-1.0.0 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc9 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc8 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc7 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc6 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc5 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc4 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc3 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc2 lib/cyclone_lariat/presenters/queues.rb
cyclone_lariat-1.0.0.rc1 lib/cyclone_lariat/presenters/queues.rb