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

Public Class Methods

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

Public Instance Methods

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