Class: TaskJuggler::CellSettingPatternList

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

Overview

The CellSettingPatternList holds a list of possible test pattern for a cell or tooltip. The first entry who’s LogicalExpression matches is used.

Instance Method Summary collapse

Constructor Details

#initializeCellSettingPatternList

Returns a new instance of CellSettingPatternList.



35
36
37
# File 'lib/taskjuggler/TableColumnDefinition.rb', line 35

def initialize
  @patterns = []
end

Instance Method Details

#addPattern(pattern) ⇒ Object

Add a new pattern to the list.



40
41
42
# File 'lib/taskjuggler/TableColumnDefinition.rb', line 40

def addPattern(pattern)
  @patterns << pattern
end

#getPattern(query) ⇒ Object

Get the RichText that matches the property and scopeProperty.



45
46
47
48
49
50
51
52
# File 'lib/taskjuggler/TableColumnDefinition.rb', line 45

def getPattern(query)
  @patterns.each do |pattern|
    if pattern.logExpr.eval(query)
      return pattern.setting
    end
  end
  nil
end