Class: HParser::Util::Concat

Inherits:
Object
  • Object
show all
Defined in:
lib/hparser/util/parser.rb

Instance Method Summary collapse

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