Class: OptionsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/obfuskit/options_parser.rb

Defined Under Namespace

Classes: ScriptOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



104
105
106
# File 'lib/obfuskit/options_parser.rb', line 104

def options
  @options
end

#parserObject (readonly)

Returns the value of attribute parser.



104
105
106
# File 'lib/obfuskit/options_parser.rb', line 104

def parser
  @parser
end

Instance Method Details

#parse(args) ⇒ Object

Return a structure describing the options.



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/obfuskit/options_parser.rb', line 92

def parse(args)
  # The options specified on the command line will be collected in
  # *options*.

  @options = ScriptOptions.new
  OptionParser.new do |parser|
    @options.define_options(parser)
    parser.parse!(args)
  end
  @options
end