Class: HammerCLI::Options::Sources::CommandLine
- Inherits:
-
Object
- Object
- 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.
Constructor Details
#initialize(command) ⇒ CommandLine
Returns a new instance of CommandLine.
5 6 7 |
# File 'lib/hammer_cli/options/sources/command_line.rb', line 5 def initialize(command) @command = command end |
Instance Method Details
#get_options(defined_options, result) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/hammer_cli/options/sources/command_line.rb', line 9 def (, result) .each do |opt| result[opt.attribute_name] ||= @command.send(opt.read_method) end result end |