Make exportDictionary and internalDictionary private vars instead of functions in FeedPasteboardWriter.

This commit is contained in:
Brent Simmons 2019-02-05 21:00:10 -08:00
parent c4e97c028b
commit 3a5741a5dd
1 changed files with 8 additions and 6 deletions

View File

@ -172,9 +172,9 @@ extension Feed: PasteboardWriterOwner {
case .URL: case .URL:
plist = feed.url plist = feed.url
case FeedPasteboardWriter.feedUTIType: case FeedPasteboardWriter.feedUTIType:
plist = exportDictionary() plist = exportDictionary
case FeedPasteboardWriter.feedUTIInternalType: case FeedPasteboardWriter.feedUTIInternalType:
plist = internalDictionary() plist = internalDictionary
default: default:
plist = nil plist = nil
} }
@ -185,13 +185,15 @@ extension Feed: PasteboardWriterOwner {
private extension FeedPasteboardWriter { private extension FeedPasteboardWriter {
func exportDictionary() -> [String: String] { var pasteboardFeed: PasteboardFeed {
let pasteboardFeed = PasteboardFeed(url: feed.url, feedID: feed.feedID, homePageURL: feed.homePageURL, name: feed.name, editedName: feed.editedName, accountID: feed.account?.accountID) return PasteboardFeed(url: feed.url, feedID: feed.feedID, homePageURL: feed.homePageURL, name: feed.name, editedName: feed.editedName, accountID: feed.account?.accountID)
}
var exportDictionary: PasteboardFeedDictionary {
return pasteboardFeed.exportDictionary() return pasteboardFeed.exportDictionary()
} }
func internalDictionary() -> [String: Any] { var internalDictionary: PasteboardFeedDictionary {
let pasteboardFeed = PasteboardFeed(url: feed.url, feedID: feed.feedID, homePageURL: feed.homePageURL, name: feed.name, editedName: feed.editedName, accountID: feed.account?.accountID)
return pasteboardFeed.internalDictionary() return pasteboardFeed.internalDictionary()
} }
} }