Methods

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 184
184:     def initialize(attribute, scenario)
185:       @scenarioIdx = scenario
186:       super
187:     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 191
191:     def eval(expr)
192:       query = expr.query
193:       query.scenarioIdx = @scenarioIdx
194:       query.attributeId = @operand1
195:       query.process
196:       # The logical expressions are mostly about comparing values. So we use
197:       # the sortableResult of the Query. This creates some challenges for load
198:       # values, as the user is not accustomed to the internal representation
199:       # of those.
200:       # Convert nil results into empty Strings if necessary
201:       query.result || ''
202:     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 206
206:     def to_s(query)
207:       if query
208:         query.process
209:         query.to_s
210:       else
211:         "#{@scenarioIdx}.#{@operand1}"
212:       end
213:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.