OSDN Git Service

CoreDataManager各クラスからAccessorを分離
[kcd/KCD.git] / KCD / BookmarkDataStore.swift
index 32acb84..ad5f9a5 100644 (file)
@@ -8,30 +8,26 @@
 
 import Cocoa
 
-extension CoreDataConfiguration {
-    static let bookmark = CoreDataConfiguration("Bookmark")
-}
-
-class BookmarkDataStore: CoreDataAccessor, CoreDataManager {
-    static let core = CoreDataCore(.bookmark)
+final class BookmarkDataStore: CoreDataManager {
+    
+    static let core = CoreDataCore(CoreDataConfiguration("Bookmark"))
     
     static let `default` = BookmarkDataStore(type: .reader)
+    
     class func oneTimeEditor() -> BookmarkDataStore {
+        
         return BookmarkDataStore(type: .editor)
     }
     
     required init(type: CoreDataManagerType) {
+        
         context = BookmarkDataStore.context(for: type)
     }
+    
     deinit {
+        
         save()
     }
     
     let context: NSManagedObjectContext
 }
-
-extension BookmarkDataStore {
-    func createBookmark() -> Bookmark? {
-        return insertNewObject(for: Bookmark.entity)
-    }
-}