Ledger
public class Ledger
extension Ledger: CustomStringConvertible
extension Ledger: Equatable
A Ledger is the main part of the model, it contains all necessary information.
-
Array of all
Transactions in this ledgerDeclaration
Swift
public private(set) var transactions: [Transaction] { get } -
Errors from the ledger and the parsing
Returns
ledgerErrorsandparsingErrorsNote: This property is computed, so please cache the resultDeclaration
Swift
public var errors: [String] { get } -
Errors which this ledger contains
This includes failed balances assertions, … Note: This property is computed, so please cache the result
Declaration
Swift
public var ledgerErrors: [String] { get } -
Errors while reading the ledger
This can be used by a parser to store errors which occurred while trying to fill in the ledger. The ledger itself will not put anything inside.
Declaration
Swift
public var parsingErrors: [String] -
Array of the main
AccountGroups (all fiveAccountTypes) in this ledgerDeclaration
Swift
public var accountGroups: [AccountGroup] { get } -
Array of all plugins
Declaration
Swift
public var plugins: [String] -
Array of all options
Declaration
Swift
public var option: [Option] -
Array of all events
Declaration
Swift
public var events: [Event] -
Array of all Custom directives
Declaration
Swift
public var custom: [Custom] -
Creates an empty ledger with the
accountGroupsset upDeclaration
Swift
public init() -
Adds a
Transcactionto the ledgerDeclaration
Swift
public func add(_ transaction: Transaction)Parameters
transactiontransaction to add
-
Retuns the ledger file for this ledger.
It consists of all
AccountandTransactionstatements, but does not includeerrorsDeclaration
Swift
public var description: String { get } -
Compares two Ledgers
Compared are the
Accounts,Transactions,Commoditys,Tags,Events,Customs, as welloptions andplugins, but not theerrorsDeclaration
Swift
public static func == (lhs: Ledger, rhs: Ledger) -> BoolParameters
lhsledger one
rhsledger two
Return Value
true if they hold the same information, otherwise false
View on GitHub
Install in Dash
Ledger Class Reference