Class TaskJuggler::Resource
In: lib/taskjuggler/Resource.rb
Parent: PropertyTreeNode

Methods

Public Class methods

[Source]

# 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

Just a shortcut to avoid the slower calls via method_missing.

[Source]

# File lib/taskjuggler/Resource.rb, line 32
    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.

[Source]

# File lib/taskjuggler/Resource.rb, line 40
    def method_missing(func, scenarioIdx, *args, &block)
      @data[scenarioIdx].method(func).call(*args, &block)
    end

[Source]

# File lib/taskjuggler/Resource.rb, line 44
    def query_dashboard(query)
      dashboard(query)
    end

[Validate]