Class: OptParseGen::ScoptParser
- Inherits:
-
Object
- Object
- OptParseGen::ScoptParser
- Defined in:
- lib/optparsegen/scopt.rb
Instance Method Summary collapse
-
#initialize(input) ⇒ ScoptParser
constructor
A new instance of ScoptParser.
- #parse ⇒ Object
Constructor Details
#initialize(input) ⇒ ScoptParser
Returns a new instance of ScoptParser.
2 3 4 5 6 |
# File 'lib/optparsegen/scopt.rb', line 2 def initialize(input) @tape = input @options = [] @current = OptParseGen::Option.new end |
Instance Method Details
#parse ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/optparsegen/scopt.rb', line 8 def parse state = :parse_any while state != nil lchomp_until!(is_not_space) state = send(state) end @options end |