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.



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

def initialize
  @patterns = []
end

Instance Method Details

#addPattern(pattern) ⇒ Object

Add a new pattern to the list.



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

def addPattern(pattern)
  @patterns << pattern
end

#getPattern(query) ⇒ Object

Get the RichText that matches the property and scopeProperty.



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

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