-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package sloth | ||
|
||
case class Method(apiName: String, methodName: String) | ||
case class Method(traitName: String, methodName: String) | ||
|
||
case class Request[T](method: Method, payload: T) { | ||
@deprecated("Use .method instead", "0.8.0") | ||
def path: List[String] = List(method.apiName, method.methodName) | ||
def path: List[String] = List(method.traitName, method.methodName) | ||
} | ||
object Request { | ||
@deprecated("""Use Request(Method("Api", "method"), payload) instead""", "0.8.0") | ||
def apply[T](path: List[String], payload: T): Request[T] = Request(methodFromList(path), payload) | ||
|
||
private[sloth] def methodFromList(path: List[String]) = path match { | ||
case List(traitName, methodName) => Method(apiName = traitName, methodName = methodName) | ||
case List(traitName, methodName) => Method(traitName = traitName, methodName = methodName) | ||
case _ => Method("", "") | ||
} | ||
} |