Class: Automux::Library::FileOptionsParser
- Inherits:
-
Object
- Object
- Automux::Library::FileOptionsParser
- Defined in:
- lib/automux/library/file_options_parser.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #getopts ⇒ Object
-
#initialize(path) ⇒ FileOptionsParser
constructor
A new instance of FileOptionsParser.
Constructor Details
#initialize(path) ⇒ FileOptionsParser
Returns a new instance of FileOptionsParser.
8 9 10 |
# File 'lib/automux/library/file_options_parser.rb', line 8 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/automux/library/file_options_parser.rb', line 6 def path @path end |
Instance Method Details
#getopts ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/automux/library/file_options_parser.rb', line 12 def getopts = file_opts_with_nil_values(path) OptionParser.new do |parser| .keys.each do |opt_name| parser.on(opt_name) { |value| [opt_name] = value } end end.parse! end |