Skip to content

Commit 48cfaf8

Browse files
committed
Account+Extensions: Updates ReadOnlyConvertible Protocol
1 parent 1dd478e commit 48cfaf8

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Yosemite/Yosemite/Model/Account+Extensions.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@ import Storage
33
import Networking
44

55

6-
// MARK: - Storage.Account Convenience Methods.
6+
// MARK: - Storage.Account: ReadOnlyConvertible
77
//
8-
extension Storage.Account {
8+
extension Storage.Account: ReadOnlyConvertible {
99

10-
/// Updates the Storage.Account with the Yosemite.Account's Payload.
10+
/// Updates the Storage.Account with the a ReadOnly.
1111
///
12-
func update(with account: Yosemite.Account) {
12+
public func update(with account: Yosemite.Account) {
1313
displayName = account.displayName
1414
email = account.email
1515
gravatarUrl = account.gravatarUrl
1616
userID = Int64(account.userID)
1717
username = account.username
1818
}
19-
}
20-
21-
22-
// MARK: - Storage.Account ReadOnlyConvertible
23-
//
24-
extension Storage.Account: ReadOnlyConvertible {
2519

2620
/// Returns a ReadOnly version of the receiver.
2721
///

Yosemite/Yosemite/Tools/ReadOnlyConvertible.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ public protocol ReadOnlyConvertible: class {
1010
///
1111
associatedtype ReadOnlyType
1212

13+
/// Updates the Receiver with the ReadOnly Instance.
14+
///
15+
func update(with entity: ReadOnlyType)
16+
1317
/// Returns a ReadOnly version of the receiver.
1418
///
1519
func toReadOnly() -> ReadOnlyType

0 commit comments

Comments
 (0)