Class: ThreeScaleToolbox::Commands::PlansCommand::List::ListSubcommand

Inherits:
Cri::CommandRunner
  • Object
show all
Includes:
ThreeScaleToolbox::Command
Defined in:
lib/3scale_toolbox/commands/plans_command/list_command.rb

Constant Summary collapse

FIELDS =
%w[id name system_name].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ThreeScaleToolbox::Command

#config, #config_file, #exit_with_message, #fetch_required_option, included, #keep_alive, #remotes, #threescale_client, #verbose, #verify_ssl

Class Method Details

.commandObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/3scale_toolbox/commands/plans_command/list_command.rb', line 10

def self.command
  Cri::Command.define do
    name        'list'
    usage       'list [opts] <remote> <service>'
    summary     'list application plans'
    description 'List application plans'

    ThreeScaleToolbox::CLI.output_flag(self)
    param       :remote
    param       :service_ref

    runner ListSubcommand
  end
end

Instance Method Details

#runObject



25
26
27
# File 'lib/3scale_toolbox/commands/plans_command/list_command.rb', line 25

def run
  printer.print_collection service.plans.map(&:attrs)
end