Class: Rubysmith::CLI::Parsers::Assembler
- Inherits:
-
Object
- Object
- Rubysmith::CLI::Parsers::Assembler
- Defined in:
- lib/rubysmith/cli/parsers/assembler.rb
Overview
Assembles and parses all Command Line Interface (CLI) options.
Constant Summary collapse
Instance Method Summary collapse
- #call(arguments = []) ⇒ Object
-
#initialize(configuration: CLI::Configuration::Loader.call, sections: SECTIONS, client: CLIENT) ⇒ Assembler
constructor
A new instance of Assembler.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(configuration: CLI::Configuration::Loader.call, sections: SECTIONS, client: CLIENT) ⇒ Assembler
Returns a new instance of Assembler.
10 11 12 13 14 15 16 |
# File 'lib/rubysmith/cli/parsers/assembler.rb', line 10 def initialize configuration: CLI::Configuration::Loader.call, sections: SECTIONS, client: CLIENT @options = configuration.to_h @sections = sections @client = client end |
Instance Method Details
#call(arguments = []) ⇒ Object
18 19 20 21 22 |
# File 'lib/rubysmith/cli/parsers/assembler.rb', line 18 def call arguments = [] sections.each { |parser| parser.call client: client, options: } client.parse! arguments end |
#to_h ⇒ Object
24 |
# File 'lib/rubysmith/cli/parsers/assembler.rb', line 24 def to_h = |
#to_s ⇒ Object
26 |
# File 'lib/rubysmith/cli/parsers/assembler.rb', line 26 def to_s = client.to_s |