Commodity

public class Commodity
extension Commodity: CustomStringConvertible
extension Commodity: Equatable

A commodity just consists of a symbol

  • symbol of the commodity

    Declaration

    Swift

    public let symbol: CommoditySymbol
  • opening of the commodity

    Declaration

    Swift

    public let opening: Date?
  • MetaData of the Commodity

    Declaration

    Swift

    public let metaData: [String : String]
  • Creates an commodity with the given symbol, and an optinal opening date

    Declaration

    Swift

    public init(symbol: CommoditySymbol, opening: Date? = nil, metaData: [String : String] = [:])

    Parameters

    symbol

    symbol of the commodity

    opening

    date the commodity was opened

  • String of the commodity definition

    If no opening is set it is an empty string

    Declaration

    Swift

    public var description: String { get }
  • Retuns if the two commodities are equal, meaning their symbols and meta data are equal

    Declaration

    Swift

    public static func == (lhs: Commodity, rhs: Commodity) -> Bool

    Parameters

    lhs

    commodity 1

    rhs

    commodity 2

    Return Value

    true if the sybols and meta data are equal, false otherwise