Class: Oldfixversion::CLI::Parsers::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/oldfixversion/cli/parsers/core.rb

Overview

Handles parsing of Command Line Interface (CLI) core options.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = Container[:configuration], client: Parser::CLIENT, **dependencies) ⇒ Core

Returns a new instance of Core.



16
17
18
19
20
21
22
23
# File 'lib/oldfixversion/cli/parsers/core.rb', line 16

def initialize configuration = Container[:configuration],
               client: Parser::CLIENT,
               **dependencies

  super(**dependencies)
  @configuration = configuration
  @client = client
end

Class Method Details

.callObject



14
# File 'lib/oldfixversion/cli/parsers/core.rb', line 14

def self.call(...) = new(...).call

Instance Method Details

#call(arguments = []) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/oldfixversion/cli/parsers/core.rb', line 25

def call arguments = []
  client.banner = specification.labeled_summary
  client.separator "\nUSAGE:\n"
  collate
  client.parse arguments
  configuration
end