Class: QuickAndRuby::Proxy::ArgParser

Inherits:
Object
  • Object
show all
Defined in:
lib/quick_and_ruby/proxy/arg_parser.rb

Overview

service parse proxy exe argv based on standard OptionParser

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ ArgParser

Returns a new instance of ArgParser.



12
13
14
15
16
17
# File 'lib/quick_and_ruby/proxy/arg_parser.rb', line 12

def initialize(argv)
  @argv = argv
  @options = { verbose: false,
               bind: '0.0.0.0',
               port: 8080 }
end

Instance Method Details

#parseObject



19
20
21
22
# File 'lib/quick_and_ruby/proxy/arg_parser.rb', line 19

def parse
  options_parser.parse!(argv)
  options
end