Class: ECG::OptionParser
- Inherits:
-
Object
- Object
- ECG::OptionParser
- Defined in:
- lib/ecg/option_parser.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#option ⇒ Object
readonly
Returns the value of attribute option.
Instance Method Summary collapse
-
#initialize(args) ⇒ OptionParser
constructor
A new instance of OptionParser.
- #parse! ⇒ Object
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
#args ⇒ Object (readonly)
Returns the value of attribute args.
10 11 12 |
# File 'lib/ecg/option_parser.rb', line 10 def args @args end |
#option ⇒ Object (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 |