Class: TaskJuggler::ScenarioData
- Defined in:
- lib/taskjuggler/ScenarioData.rb
Direct Known Subclasses
AccountScenario, ReportScenario, ResourceScenario, ShiftScenario, TaskScenario
Instance Attribute Summary collapse
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
- #a(attributeName) ⇒ Object
-
#deep_clone ⇒ Object
We only use deep_clone for attributes, never for properties.
- #error(id, text, sourceFileInfo = nil, property = nil) ⇒ Object
- #info(id, text, sourceFileInfo = nil, property = nil) ⇒ Object
-
#initialize(property, idx, attributes) ⇒ ScenarioData
constructor
A new instance of ScenarioData.
- #warning(id, text, sourceFileInfo = nil, property = nil) ⇒ Object
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
#property ⇒ Object (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_clone ⇒ Object
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 |