Class: Hscode::InputParser
- Inherits:
-
Object
- Object
- Hscode::InputParser
- Defined in:
- lib/hscode/input_parser.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ InputParser
constructor
A new instance of InputParser.
- #parse(args) ⇒ Object
Constructor Details
#initialize ⇒ InputParser
Returns a new instance of InputParser.
7 8 9 |
# File 'lib/hscode/input_parser.rb', line 7 def initialize @options = OpenStruct.new end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/hscode/input_parser.rb', line 5 def @options end |
Instance Method Details
#parse(args) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/hscode/input_parser.rb', line 11 def parse(args) option_parser.parse!(args) rescue OptionParser::InvalidOption, OptionParser::InvalidArgument, OptionParser::MissingArgument => e puts e, "See 'hscode --help'." exit 1 end |