Methods

Files

Class Index [+]

Quicksearch

TaskJuggler::LogicalAttribute

This class handles operands that are property attributes. They are addressed by attribute ID and scenario index. The expression provides the property reference.

Public Class Methods

new(attribute, scenario) click to toggle source
     # File lib/LogicalOperation.rb, line 179
179:     def initialize(attribute, scenario)
180:       @scenarioIdx = scenario
181:       super
182:     end

Public Instance Methods

eval(expr) click to toggle source

To evaluate a property attribute we use the Query mechanism to retrieve the value.

     # File lib/LogicalOperation.rb, line 186
186:     def eval(expr)
187:       query = expr.query
188:       query.scenarioIdx = @scenarioIdx
189:       query.attributeId = @operand1
190:       query.process
191:       # The logical expressions are mostly about comparing values. So we use
192:       # the sortableResult of the Query. This creates some challenges for load
193:       # values, as the user is not accustomed to the internal representation
194:       # of those.
195:       # Convert nil results into empty Strings if necessary
196:       query.result || ''
197:     end
to_s(query) click to toggle source

Dumps the LogicalOperation as String. If query is nil, the variable names are shown, otherwise their values.

     # File lib/LogicalOperation.rb, line 201
201:     def to_s(query)
202:       if query
203:         query.process
204:         query.to_s
205:       else
206:         "#{@scenarioIdx}.#{@operand1}"
207:       end
208:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.