Skip to content

Commit 28cf869

Browse files
committed
Adopt new Swift naming scheme some more
1 parent 18c2711 commit 28cf869

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

MarvelKit/MarvelKit/Extensions/NSURL+Parameters.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public typealias URLParameters = [String: String]
1212

1313
public extension URLComponents {
1414

15-
public func byAppendingQueryItems(_ queryItems: [URLQueryItem]) -> URLComponents {
15+
public func appendingQueryItems(_ queryItems: [URLQueryItem]) -> URLComponents {
1616

1717
var copy = self
1818

@@ -23,16 +23,16 @@ public extension URLComponents {
2323
return copy
2424
}
2525

26-
public func byAppendParameters(_ parameters: URLParameters) -> URLComponents {
27-
return byAppendingQueryItems(parameters.flatMap { key, value in URLQueryItem(name: key, value: value) })
26+
public func appendingParameters(_ parameters: URLParameters) -> URLComponents {
27+
return appendingQueryItems(parameters.flatMap { key, value in URLQueryItem(name: key, value: value) })
2828
}
2929

3030
}
3131

3232
public extension URL {
3333

34-
public func byAppendingParameters(_ parameters: URLParameters) -> URL? {
35-
return URLComponents(string: absoluteString)?.byAppendParameters(parameters).url
34+
public func appendingParameters(_ parameters: URLParameters) -> URL? {
35+
return URLComponents(string: absoluteString)?.appendingParameters(parameters).url
3636
}
3737

3838
}

MarvelKit/MarvelKit/Request/Request.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ open class Request<Resource: DataResourceProtocol> {
1919
// MARK: Internal initializers
2020

2121
init(resource: Resource.Type, authentication: Authentication) {
22-
url = resource.absoluteURL()?.byAppendingParameters(authentication.params())
22+
url = resource.absoluteURL()?.appendingParameters(authentication.params())
2323
}
2424

2525
init(resource: Resource.Type, authentication: Authentication, id: Int) {
26-
url = resource.absoluteURL(id: id)?.byAppendingParameters(authentication.params())
26+
url = resource.absoluteURL(id: id)?.appendingParameters(authentication.params())
2727
}
2828

2929
init(resource: Resource.Type, authentication: Authentication, filter: ResourceFilter<Resource.ResourceFilterType>) {
30-
url = resource.absoluteURL(filter: filter)?.byAppendingParameters(authentication.params())
30+
url = resource.absoluteURL(filter: filter)?.appendingParameters(authentication.params())
3131
}
3232

3333
// MARK: Public builders
3434

3535
open func withParameters(_ parameters: [Resource.ResourceParameterType]) -> Request<Resource> {
36-
url = url?.byAppendingParameters(parameters.urlParameters)
36+
url = url?.appendingParameters(parameters.urlParameters)
3737
return self
3838
}
3939

0 commit comments

Comments
 (0)