Skip to content

Commit 6526d1a

Browse files
committed
Networking.Site: New Initializer
1 parent ef8ef13 commit 6526d1a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Networking/Networking/Model/Site.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public struct Site: Decodable {
2626
public let isWordPressStore: Bool
2727

2828

29-
/// Designated Initializer.
29+
/// Decodable Conformance.
3030
///
3131
public init(from decoder: Decoder) throws {
3232
let siteContainer = try decoder.container(keyedBy: SiteKeys.self)
@@ -39,6 +39,16 @@ public struct Site: Decodable {
3939
let optionsContainer = try siteContainer.nestedContainer(keyedBy: OptionKeys.self, forKey: .options)
4040
isWordPressStore = try optionsContainer.decode(Bool.self, forKey: .isWordPressStore)
4141
}
42+
43+
/// Designated Initializer.
44+
///
45+
public init(siteID: Int, name: String, description: String, url: String, isWordPressStore: Bool) {
46+
self.siteID = siteID
47+
self.name = name
48+
self.description = description
49+
self.url = url
50+
self.isWordPressStore = isWordPressStore
51+
}
4252
}
4353

4454

0 commit comments

Comments
 (0)