Sha256: 3f806a4648316900cfb6326de7f46fae928dbe44728178ce258cbc9e3bcec50a

Contents?: true

Size: 503 Bytes

Versions: 5

Compression:

Stored size: 503 Bytes

Contents

require 'terminal-table'

module VagrantPlugins
  module ConoHa
    module Command
      module Utils
        def display_item_list(env, items)
          rows = []
          items.each do |item|
            rows << [item.id, item.name]
          end
          display_table(env, %w(ID Name), rows)
        end

        def display_table(env, headers, rows)
          table = Terminal::Table.new headings: headers, rows: rows
          env[:ui].info("\n#{table}")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vagrant-conoha-0.1.10 lib/vagrant-conoha/command/utils.rb
vagrant-conoha-0.1.9 lib/vagrant-conoha/command/utils.rb
vagrant-conoha-0.1.8 lib/vagrant-conoha/command/utils.rb
vagrant-conoha-0.1.7 lib/vagrant-conoha/command/utils.rb
vagrant-conoha-0.1.6 lib/vagrant-conoha/command/utils.rb