Class: HParser::Util::Many1
- Inherits:
-
Object
- Object
- HParser::Util::Many1
- Defined in:
- lib/hparser/util/parser.rb
Instance Method Summary collapse
-
#initialize(parser) ⇒ Many1
constructor
A new instance of Many1.
- #parse(*args) ⇒ Object
Constructor Details
#initialize(parser) ⇒ Many1
Returns a new instance of Many1.
4 5 6 |
# File 'lib/hparser/util/parser.rb', line 4 def initialize(parser) @parser = parser end |
Instance Method Details
#parse(*args) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/hparser/util/parser.rb', line 8 def parse(*args) result = [] while (r = @parser.parse(*args)) result.push r end result==[] ? nil : result end |