Class: Unfig::ArgvLoader

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

Instance Method Summary collapse

Constructor Details

#initialize(params:, argv:) ⇒ ArgvLoader

Returns a new instance of ArgvLoader.



3
4
5
6
7
8
# File 'lib/unfig/argv_loader.rb', line 3

def initialize(params:, argv:)
  @params = params
  @argv = argv
  @options = {}
  @stop_early = false
end

Instance Method Details

#readObject



10
11
12
13
14
# File 'lib/unfig/argv_loader.rb', line 10

def read
  return @_read if defined?(@_read)
  option_parser.parse!(argv)
  @_read = @stop_early ? nil : @options
end