Class: TaskJuggler::ScenarioData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, idx, attributes) ⇒ ScenarioData

Returns a new instance of ScenarioData.



23
24
25
26
27
28
29
30
31
32
# File 'lib/taskjuggler/ScenarioData.rb', line 23

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

Instance Attribute Details

#propertyObject (readonly)

Returns the value of attribute property.



21
22
23
# File 'lib/taskjuggler/ScenarioData.rb', line 21

def property
  @property
end

Instance Method Details

#a(attributeName) ⇒ Object



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

def a(attributeName)
  @attributes[attributeName].get
end

#deep_cloneObject

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



37
38
39
# File 'lib/taskjuggler/ScenarioData.rb', line 37

def deep_clone
  self
end

#error(id, text, sourceFileInfo = nil, property = nil) ⇒ Object



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

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) ⇒ Object



59
60
61
62
63
64
# File 'lib/taskjuggler/ScenarioData.rb', line 59

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) ⇒ Object



52
53
54
55
56
57
# File 'lib/taskjuggler/ScenarioData.rb', line 52

def warning(id, text, sourceFileInfo = nil, property = nil)
  @messageHandler.warning(
    id, text, sourceFileInfo || @property.sourceFileInfo, nil,
    property || @property,
    @project.scenario(@scenarioIdx))
end