class TaskJuggler::Account
An Account
is an object to record financial transactions. Alternatively, an Account
can just be a container for a set of Accounts. In this case it cannot directly record any transactions.
Public Class Methods
Source
# File lib/taskjuggler/Account.rb, line 25 def initialize(project, id, name, parent) super(project.accounts, id, name, parent) project.addAccount(self) @data = Array.new(@project.scenarioCount, nil) @project.scenarioCount.times do |i| AccountScenario.new(self, i, @scenarioAttributes[i]) end end
Calls superclass method
Public Instance Methods
Source
# File lib/taskjuggler/Account.rb, line 39 def method_missing(func, scenarioIdx, *args) @data[scenarioIdx].method(func).call(*args) end
Many Account
functions are scenario specific. These functions are provided by the class AccountScenario
. In case we can’t find a function called for the Account
class we try to find it in AccountScenario
.
Source
# File lib/taskjuggler/Account.rb, line 44 def scenario(scenarioIdx) return @data[scenarioIdx] end
Return a reference to the scenarioIdx-th scenario.