class TaskJuggler::Resource

Public Class Methods

new(project, id, name, parent) click to toggle source
Calls superclass method TaskJuggler::PropertyTreeNode::new
# File lib/taskjuggler/Resource.rb, line 21
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

Public Instance Methods

book(scenarioIdx, sbIdx, task) click to toggle source

Just a shortcut to avoid the slower calls via method_missing.

# File lib/taskjuggler/Resource.rb, line 32
def book(scenarioIdx, sbIdx, task)
  @data[scenarioIdx].book(sbIdx, task)
end
method_missing(func, scenarioIdx = 0, *args, &block) click to toggle source

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 40
def method_missing(func, scenarioIdx = 0, *args, &block)
  @data[scenarioIdx].method(func).call(*args, &block)
end
query_dashboard(query) click to toggle source
# File lib/taskjuggler/Resource.rb, line 44
def query_dashboard(query)
  dashboard(query)
end