Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Update to latest version of Moya (#7)
Browse files Browse the repository at this point in the history
This commit updates to the latest version of Moya, while updating the library to reflect the new changes.
  • Loading branch information
nuudles authored and RyogaK committed Jan 27, 2017
1 parent a0fe78f commit 240e55a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "Alamofire/Alamofire" "4.2.0"
github "Alamofire/Alamofire" "4.3.0"
github "antitypical/Result" "3.1.0"
github "ReactiveX/RxSwift" "3.0.1"
github "johnsundell/unbox" "2.2.1"
github "ReactiveCocoa/ReactiveSwift" "1.0.0-alpha.3"
github "Moya/Moya" "8.0.0-beta.5"
github "ReactiveX/RxSwift" "3.1.0"
github "johnsundell/unbox" "2.3.0"
github "ReactiveCocoa/ReactiveSwift" "1.0.0"
github "Moya/Moya" "8.0.1"
12 changes: 6 additions & 6 deletions Sources/Response+Unbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@ import Unbox
public extension Response {
public func unbox<T: Unboxable>(object: T.Type) throws -> T {
guard let json = try mapJSON() as? UnboxableDictionary else {
throw Error.jsonMapping(self)
throw MoyaError.jsonMapping(self)
}
return try Unbox.unbox(dictionary: json)
}

public func unbox<T: Unboxable>(object: T.Type, atKey: String) throws -> T {
guard let json = try mapJSON() as? UnboxableDictionary else {
throw Error.jsonMapping(self)
throw MoyaError.jsonMapping(self)
}
return try Unbox.unbox(dictionary: json, atKey: atKey)
}

public func unbox<T: Unboxable>(object: T.Type, atKeyPath: String) throws -> T {
guard let json = try mapJSON() as? UnboxableDictionary else {
throw Error.jsonMapping(self)
throw MoyaError.jsonMapping(self)
}
return try Unbox.unbox(dictionary: json, atKeyPath: atKeyPath)
}

public func unbox<T: Unboxable>(array: T.Type) throws -> [T] {
guard let jsonArray = try mapJSON() as? [UnboxableDictionary] else {
throw Error.jsonMapping(self)
throw MoyaError.jsonMapping(self)
}
return try Unbox.unbox(dictionaries: jsonArray)
}

public func unbox<T: Unboxable>(array: T.Type, atKey: String) throws -> [T] {
guard let json = try mapJSON() as? UnboxableDictionary else {
throw Error.jsonMapping(self)
throw MoyaError.jsonMapping(self)
}
return try Unbox.unbox(dictionary: json, atKey: atKey)
}

public func unbox<T: Unboxable>(array: T.Type, atKeyPath: String) throws -> [T] {
guard let json = try mapJSON() as? UnboxableDictionary else {
throw Error.jsonMapping(self)
throw MoyaError.jsonMapping(self)
}
return try Unbox.unbox(dictionary: json, atKeyPath: atKeyPath)
}
Expand Down

0 comments on commit 240e55a

Please # to comment.