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 20
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 31
def book(scenarioIdx, sbIdx, task)
  @data[scenarioIdx].book(sbIdx, task)
end
method_missing(func, scenarioIdx, *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 39
def method_missing(func, scenarioIdx, *args, &block)
  @data[scenarioIdx].method(func).call(*args, &block)
end
query_dashboard(query) click to toggle source
# File lib/taskjuggler/Resource.rb, line 43
def query_dashboard(query)
  dashboard(query)
end