PropertyTreeNode
# File lib/taskjuggler/Resource.rb, line 19 def initialize(project, id, name, parent) super(project.resources, id, name, parent) project.addResource(self) @data = Array.new(@project.scenarioCount, nil) @project.scenarioCount.times do |i| ResourceScenario.new(self, i, @scenarioAttributes[i]) end end
Just a shortcut to avoid the slower calls via method_missing.
# File lib/taskjuggler/Resource.rb, line 30 def book(scenarioIdx, sbIdx, task) @data[scenarioIdx].book(sbIdx, task) end
Many Resource functions are scenario specific. These functions are provided by the class ResourceScenario. In case we can’t find a function called for the Resource class we try to find it in ResourceScenario.
# File lib/taskjuggler/Resource.rb, line 38 def method_missing(func, scenarioIdx, *args, &block) @data[scenarioIdx].method(func).call(*args, &block) end
Generated with the Darkfish Rdoc Generator 2.