Class: Racli::OptionParser
- Inherits:
-
Object
- Object
- Racli::OptionParser
- Defined in:
- lib/racli/option_parser.rb
Instance Method Summary collapse
Instance Method Details
#call(args) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/racli/option_parser.rb', line 7 def call(args) , args = parse(args) config_params = { config: [:config], rcfile: [:rcfile] } params = { method: 'GET', path: '/' } params[:method] = args[0] unless args.empty? params[:path] = args[1] if args.length > 1 request_params = .dup request_params.delete(:config) request_params.delete(:rcfile) params[:params] = request_params [config_params, params] end |