Class: ItchRewards::CLI::Commands::Rewards::List
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- ItchRewards::CLI::Commands::Rewards::List
- Includes:
- AuthOptions, Helper
- Defined in:
- lib/itch_rewards/cli.rb
Instance Method Summary collapse
Methods included from Helper
#authenticated_client, #authenticated_client!, #cli, #color, #objects_to_table, #render_table, #show_rewards
Methods included from AuthOptions
Instance Method Details
#call(**options) ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/itch_rewards/cli.rb', line 172 def call(**) if [:id].nil? && [:name].nil? cli.error "Game ID or game name argument is required" exit 1 end client = authenticated_client!() game = [:id] ? client.game([:id]) : client.game(name: [:name]) show_rewards(game) end |