class TaskJuggler::ScenarioData

Attributes

property[R]

Public Class Methods

new(property, idx, attributes) click to toggle source
# File lib/taskjuggler/ScenarioData.rb, line 22
def initialize(property, idx, attributes)
  @property = property
  @project = property.project
  @scenarioIdx = idx
  @attributes = attributes
  @messageHandler = MessageHandlerInstance.instance

  # Register the scenario with the Task.
  @property.data[idx] = self
end

Public Instance Methods

a(attributeName) click to toggle source
# File lib/taskjuggler/ScenarioData.rb, line 40
def a(attributeName)
  @attributes[attributeName].get
end
deep_clone() click to toggle source

We only use #deep_clone for attributes, never for properties. Since attributes may reference properties these references should remain references.

# File lib/taskjuggler/ScenarioData.rb, line 36
def deep_clone
  self
end
error(id, text, sourceFileInfo = nil, property = nil) click to toggle source
# File lib/taskjuggler/ScenarioData.rb, line 44
def error(id, text, sourceFileInfo = nil, property = nil)
  @messageHandler.error(
    id, text, sourceFileInfo || @property.sourceFileInfo, nil,
    property || @property,
    @project.scenario(@scenarioIdx))
end
info(id, text, sourceFileInfo = nil, property = nil) click to toggle source
# File lib/taskjuggler/ScenarioData.rb, line 58
def info(id, text, sourceFileInfo = nil, property = nil)
  @messageHandler.info(
    id, text, sourceFileInfo || @property.sourceFileInfo, nil,
    property || @property,
    @project.scenario(@scenarioIdx))
end
warning(id, text, sourceFileInfo = nil, property = nil) click to toggle source
# File lib/taskjuggler/ScenarioData.rb, line 51
def warning(id, text, sourceFileInfo = nil, property = nil)
  @messageHandler.warning(
    id, text, sourceFileInfo || @property.sourceFileInfo, nil,
    property || @property,
    @project.scenario(@scenarioIdx))
end