Class: CandyCheck::CLI::Commands::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/candy_check/cli/commands/base.rb

Overview

Base for all commands providing simple support for running a single command and printing to an Out instance

Direct Known Subclasses

AppStore, PlayStore, Version

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Base

Initialize a new command and prepare options for the run

Parameters:

  • options (Object) (defaults to: nil)


9
10
11
# File 'lib/candy_check/cli/commands/base.rb', line 9

def initialize(options = nil)
  @options = options
end

Class Method Details

.run(*args) ⇒ Base

Run a single instance of a command

Parameters:

  • args (Array)

    arguments for the command

Returns:

  • (Base)

    the command after the run



16
17
18
# File 'lib/candy_check/cli/commands/base.rb', line 16

def self.run(*args)
  new(*args).tap(&:run)
end