class Devpad::CLI::Commands::Pad::List
Public Class Methods
new(shell:)
click to toggle source
# File lib/devpad/cli/commands/pad/list.rb, line 6 def initialize(shell:) @shell = shell end
Public Instance Methods
execute(params = {})
click to toggle source
# File lib/devpad/cli/commands/pad/list.rb, line 10 def execute(params = {}) rows = Devpad::API::Pad.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