Class: TaskJuggler::TextParser::TextParserResultArray

Inherits:
Array
  • Object
show all
Defined in:
lib/taskjuggler/TextParser.rb

Overview

Utility class so that we can distinguish Array results from the Array containing the results of a repeatable rule. We define some merging method with a slightly different behaviour.

Instance Method Summary collapse

Constructor Details

#initializeTextParserResultArray

Returns a new instance of TextParserResultArray.



60
61
62
# File 'lib/taskjuggler/TextParser.rb', line 60

def initialize
  super
end

Instance Method Details

#<<(arg) ⇒ Object

If there is a repeatable rule that contains another repeatable loop, the result of the inner rule is an Array that gets put into another Array by the outer rule. In this case, the inner Array can be merged with the outer Array.



68
69
70
71
72
73
74
# File 'lib/taskjuggler/TextParser.rb', line 68

def <<(arg)
  if arg.is_a?(TextParserResultArray)
    self.concat(arg)
  else
    super
  end
end