Class: HParser::Util::Concat
- Inherits:
-
Object
- Object
- HParser::Util::Concat
- Defined in:
- lib/hparser/util/parser.rb
Instance Method Summary collapse
-
#initialize(*parsers) ⇒ Concat
constructor
A new instance of Concat.
- #parse(*args) ⇒ Object
Constructor Details
#initialize(*parsers) ⇒ Concat
Returns a new instance of Concat.
29 30 31 |
# File 'lib/hparser/util/parser.rb', line 29 def initialize(*parsers) @parsers = parsers end |
Instance Method Details
#parse(*args) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/hparser/util/parser.rb', line 33 def parse(*args) result = [] for parser in @parsers r = parser.parse(*args) unless r then return nil end result.push r end result end |