Class: ECG::OptionParser

Inherits:
Object
  • Object
show all
Defined in:
lib/ecg/option_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ OptionParser



12
13
14
15
# File 'lib/ecg/option_parser.rb', line 12

def initialize(args)
  @args = args
  @option = {}
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



10
11
12
# File 'lib/ecg/option_parser.rb', line 10

def args
  @args
end

#optionObject (readonly)

Returns the value of attribute option.



10
11
12
# File 'lib/ecg/option_parser.rb', line 10

def option
  @option
end

Instance Method Details

#parse!Object



17
18
19
20
21
22
# File 'lib/ecg/option_parser.rb', line 17

def parse!
  parser.parse!(@args)
  print_help(false) if @args.length > 1

  Store.new(hash)
end