Class: OptionsGetter

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

Instance Method Summary collapse

Constructor Details

#initializeOptionsGetter



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.banner = '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_optionsObject



19
20
21
22
# File 'lib/options_getter.rb', line 19

def get_options
  @options_parser.parse!
  return @options
end