Class: Swgr2rb::CliOptionsParser

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

Overview

CliOptionsParser parses arguments received from command line and generates parameters for endpoint generation.

Instance Method Summary collapse

Constructor Details

#initializeCliOptionsParser

Returns a new instance of CliOptionsParser.



10
11
12
# File 'lib/cli/cli_options_parser.rb', line 10

def initialize
  @params = default_params
end

Instance Method Details

#parse(args) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/cli/cli_options_parser.rb', line 14

def parse(args)
  option_parser = OptionParser.new do |parser|
    define_options(parser)
  end
  parse_options(option_parser, args)
  path = parse_swagger_path_from_args(args)
  [path, @params]
end