Class: HammerCLI::Options::Sources::CommandLine
- Inherits:
-
Base
- Object
- OptionProcessor
- Base
- HammerCLI::Options::Sources::CommandLine
- Defined in:
- lib/hammer_cli/options/sources/command_line.rb
Instance Method Summary collapse
- #get_options(defined_options, result) ⇒ Object
-
#initialize(command) ⇒ CommandLine
constructor
A new instance of CommandLine.
Methods inherited from Base
Methods inherited from OptionProcessor
Constructor Details
#initialize(command) ⇒ CommandLine
Returns a new instance of CommandLine.
7 8 9 |
# File 'lib/hammer_cli/options/sources/command_line.rb', line 7 def initialize(command) @command = command end |
Instance Method Details
#get_options(defined_options, result) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/hammer_cli/options/sources/command_line.rb', line 11 def (, result) .each do |opt| result[opt.attribute_name] ||= @command.send(opt.read_method) end result end |