We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a8f275 commit cfad398Copy full SHA for cfad398
Yosemite/Yosemite/Model/Site+ReadOnlyConvertible.swift
@@ -0,0 +1,28 @@
1
+import Foundation
2
+import Storage
3
+
4
5
+// Storage.Site: ReadOnlyConvertible Conformance.
6
+//
7
+extension Storage.Site: ReadOnlyConvertible {
8
9
+ /// Updates the Storage.Site with the a ReadOnly.
10
+ ///
11
+ public func update(with site: Yosemite.Site) {
12
+ siteID = Int64(site.siteID)
13
+ name = site.name
14
+ tagline = site.description
15
+ url = site.url
16
+ isWordPressStore = site.isWordPressStore
17
+ }
18
19
+ /// Returns a ReadOnly version of the receiver.
20
21
+ public func toReadOnly() -> Yosemite.Site {
22
+ return Site(siteID: Int(siteID),
23
+ name: name ?? "",
24
+ description: tagline ?? "",
25
+ url: url ?? "",
26
+ isWordPressStore: isWordPressStore)
27
28
+}
0 commit comments