Class: ImgFetcher::CommandLine

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

Defined Under Namespace

Classes: MissingOptionError

Constant Summary collapse

DEFAULT_DIRECTORY =
-'./'

Instance Method Summary collapse

Constructor Details

#initializeCommandLine

Returns a new instance of CommandLine.



6
7
8
9
10
# File 'lib/img_fetcher/command_line.rb', line 6

def initialize
  @arguments = {}
  @options = OptionParser.new
  initialize_options
end

Instance Method Details

#parse!Object



12
13
14
15
16
# File 'lib/img_fetcher/command_line.rb', line 12

def parse!
  @options.parse!
  check_required_arguments
  @arguments
end