class Devpad::CLI::Commands::Repository::List

Public Class Methods

new(shell:) click to toggle source
# File lib/devpad/cli/commands/repository/list.rb, line 6
def initialize(shell:)
  @shell = shell
end

Public Instance Methods

execute(params = {}) click to toggle source
# File lib/devpad/cli/commands/repository/list.rb, line 10
def execute(params = {})
  rows = Devpad::API::Repository.all(params).each_with_index.map do |pad, index|
    [index + 1, pad.name, pad.user_name, pad.token, pad.status]
  end
  @shell.print_table rows
  @shell.say "(Page #{params['page']})"
end