Class: Automux::Library::FileOptionsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/automux/library/file_options_parser.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (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

#getoptsObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/automux/library/file_options_parser.rb', line 12

def getopts
  options = file_opts_with_nil_values(path)

  OptionParser.new do |parser|
    options.keys.each do |opt_name|
      parser.on(opt_name) { |value| options[opt_name] = value }
    end
  end.parse!

  options
end