2 // NyukyoDockMapper.swift
5 // Created by Hori,Masaki on 2017/02/24.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 final class NyukyoDockMapper: JSONMapper {
13 let apiResponse: APIResponse
14 let configuration: MappingConfiguration<NyukyoDock>
16 required init(_ apiResponse: APIResponse) {
18 self.apiResponse = apiResponse
19 self.configuration = MappingConfiguration(entity: NyukyoDock.entity,
20 dataKeys: NyukyoDockMapper.dataKeys(apiResponse),
21 editorStore: ServerDataStore.oneTimeEditor())
24 private class func dataKeys(_ apiResponse: APIResponse) -> [String] {
26 switch apiResponse.api.endpoint {
28 case .port: return ["api_data", "api_ndock"]
30 case .ndock: return ["api_data"]
34 Logger.shared.log("Missing API: \(apiResponse.api)")