Class: OptionsGetter
- Inherits:
-
Object
- Object
- OptionsGetter
- Defined in:
- lib/options_getter.rb
Instance Method Summary collapse
- #get_options ⇒ Object
-
#initialize ⇒ OptionsGetter
constructor
A new instance of OptionsGetter.
Constructor Details
#initialize ⇒ OptionsGetter
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/options_getter.rb', line 2 def initialize @exiter = Exiter.new @options = {exact: false} @options_parser = OptionParser.new do |opts| opts. = 'Usage: droiddocs.rb [options] search_term' opts.on('-e', '--exact', 'Search for the exact class') do |v| @options[:exact] = true end opts.on('-h', '--help', 'Displays Help') do puts opts @exiter.exit_after_showing_help end end end |
Instance Method Details
#get_options ⇒ Object
19 20 21 22 |
# File 'lib/options_getter.rb', line 19 def @options_parser.parse! return @options end |