Skip to content

Commit

Permalink
fixed variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Marwaha committed Aug 3, 2018
1 parent c8abc6d commit a4e8065
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 7.2.2

- Adds optional `requestTimeInterval` property to `NetworkResourceType` which can be used to set a `URLRequest` specific timeout for the resource.
- Adds optional `requestTimeoutInterval` property to `NetworkResourceType` which can be used to set a `URLRequest` specific timeout for the resource.

## 7.2.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public protocol NetworkResourceType {
var queryItems: [URLQueryItem]? { get }

/// The time interval for the URLRequest for this resource
var requestTimeInterval: TimeInterval? { get }
var requestTimeoutInterval: TimeInterval? { get }

/**
Convenience function that builds a URLRequest for this resource
Expand All @@ -77,7 +77,7 @@ public extension NetworkResourceType {
public var httpHeaderFields: [String: String]? { return [:] }
public var jsonBody: Any? { return nil }
public var queryItems: [URLQueryItem]? { return nil }
public var requestTimeInterval: TimeInterval? { return nil }
public var requestTimeoutInterval: TimeInterval? { return nil }

public func urlRequest() -> URLRequest? {
var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)
Expand All @@ -86,7 +86,7 @@ public extension NetworkResourceType {

guard let urlFromComponents = urlComponents?.url else { return nil }
var request: URLRequest
if let timeoutInterval = requestTimeInterval {
if let timeoutInterval = requestTimeoutInterval {
request = URLRequest(url: urlFromComponents, timeoutInterval: timeoutInterval)
} else {
request = URLRequest(url: urlFromComponents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private struct MockCustomNetworkResource: NetworkResourceType {
let httpHeaderFields: [String: String]?
let jsonBody: Any?
let queryItems: [URLQueryItem]?
let requestTimeInterval: TimeInterval? = 27
let requestTimeoutInterval: TimeInterval? = 27

init(url: URL, httpRequestMethod: HTTPMethod = .get, httpHeaderFields: [String : String]? = nil, jsonBody: Any? = nil, queryItems: [URLQueryItem]? = nil) {
self.url = url
Expand Down

0 comments on commit a4e8065

Please sign in to comment.