-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pump ops for fetching recent glucose
- Loading branch information
Showing
5 changed files
with
189 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// TimestampedGlucoseEvent.swift | ||
// RileyLink | ||
// | ||
// Created by Timothy Mecklem on 10/19/16. | ||
// Copyright © 2016 Pete Schwamb. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct TimestampedGlucoseEvent { | ||
public let glucoseEvent: GlucoseEvent | ||
public let date: Date | ||
|
||
public func isMutable(atDate date: Date = Date()) -> Bool { | ||
return false | ||
} | ||
|
||
public init(glucoseEvent: GlucoseEvent, date: Date) { | ||
self.glucoseEvent = glucoseEvent | ||
self.date = date | ||
} | ||
} | ||
|
||
|
||
extension TimestampedGlucoseEvent: DictionaryRepresentable { | ||
public var dictionaryRepresentation: [String : Any] { | ||
var dict = glucoseEvent.dictionaryRepresentation | ||
|
||
dict["timestamp"] = DateFormatter.ISO8601DateFormatter().string(from: date) | ||
|
||
return dict | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters