Class: Rubysmith::CLI::Parsers::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/cli/parsers/build.rb

Overview

Handles parsing of Command Line Interface (CLI) build options. :reek:TooManyMethods

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options: {}, client: CLIENT) ⇒ Build

Returns a new instance of Build.



11
12
13
14
# File 'lib/rubysmith/cli/parsers/build.rb', line 11

def initialize options: {}, client: CLIENT
  @options = options
  @client = client
end

Class Method Details

.call(options: {}, client: CLIENT) ⇒ Object



9
# File 'lib/rubysmith/cli/parsers/build.rb', line 9

def self.call(options: {}, client: CLIENT) = new(options: options, client: client).call

Instance Method Details

#call(arguments = []) ⇒ Object



16
17
18
19
20
# File 'lib/rubysmith/cli/parsers/build.rb', line 16

def call arguments = []
  client.separator "\nBUILD OPTIONS:\n"
  private_methods.sort.grep(/add_/).each { |method| __send__ method }
  arguments.empty? ? arguments : client.parse!(arguments)
end