Class: Oldfixversion::CLI::Parser
- Inherits:
-
Object
- Object
- Oldfixversion::CLI::Parser
- Defined in:
- lib/oldfixversion/cli/parser.rb
Overview
Assembles and parses all Command Line Interface (CLI) options.
Constant Summary collapse
Instance Method Summary collapse
- #call(arguments = []) ⇒ Object
-
#initialize(sections: SECTIONS, client: CLIENT, **dependencies) ⇒ Parser
constructor
A new instance of Parser.
- #to_s ⇒ Object
Constructor Details
#initialize(sections: SECTIONS, client: CLIENT, **dependencies) ⇒ Parser
Returns a new instance of Parser.
16 17 18 19 20 21 22 |
# File 'lib/oldfixversion/cli/parser.rb', line 16 def initialize sections: SECTIONS, client: CLIENT, **dependencies super(**dependencies) @sections = sections @client = client @configuration_duplicate = configuration.dup end |
Instance Method Details
#call(arguments = []) ⇒ Object
24 25 26 27 28 |
# File 'lib/oldfixversion/cli/parser.rb', line 24 def call arguments = [] sections.each { |section| section.call configuration_duplicate, client: } client.parse arguments configuration_duplicate.freeze end |
#to_s ⇒ Object
30 |
# File 'lib/oldfixversion/cli/parser.rb', line 30 def to_s = client.to_s |