COBStatus.swift 572 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // COBStatus.swift
  3. // RileyLink
  4. //
  5. // Created by Pete Schwamb on 8/2/16.
  6. // Copyright © 2016 Pete Schwamb. All rights reserved.
  7. //
  8. import Foundation
  9. public struct COBStatus {
  10. let cob: Double
  11. let timestamp: Date
  12. public init(cob: Double, timestamp: Date) {
  13. self.cob = cob // grams
  14. self.timestamp = timestamp
  15. }
  16. public var dictionaryRepresentation: [String: Any] {
  17. var rval = [String: Any]()
  18. rval["timestamp"] = TimeFormat.timestampStrFromDate(timestamp)
  19. rval["cob"] = cob
  20. return rval
  21. }
  22. }