Posting
public class Posting
extension Posting: CustomStringConvertible
extension Posting: Equatable
extension Posting: Hashable
A Posting contains an AccountName
with the corresponding Amount
,
as well as the price
and cost
(if applicable).
-
AccountName
of the account the posting is inDeclaration
Swift
public let accountName: AccountName
-
Declaration
Swift
public let price: Amount?
-
MetaData of the Posting
Declaration
Swift
public let metaData: [String : String]
-
Creats an posting with the given parameters
Declaration
Swift
public init(accountName: AccountName, amount: Amount, price: Amount? = nil, cost: Cost? = nil, metaData: [String : String] = [:])
Parameters
accountName
amount
price
cost
-
String to describe the posting in the ledget file
Declaration
Swift
public var description: String { get }
-
Compares two postings
If a
price
is set it must matchDeclaration
Swift
public static func == (lhs: Posting, rhs: Posting) -> Bool
Parameters
lhs
first posting
rhs
second posting
Return Value
if the accountName, ammount, meta data and price are the same on both postings
-
Declaration
Swift
public func hash(into hasher: inout Hasher)