11import Foundation
22
3- open class InteractorExecuter {
3+ class InteractorExecuter {
44
5- fileprivate var interactors = Dictionary < String , AnyObject > ( )
5+ private var interactors = Dictionary < String , AnyObject > ( )
66
77 // MARK: Register
88
9- open func registerInteractor< InteractorProtocol: Interactor , Response>
9+ func registerInteractor< InteractorProtocol: Interactor , Response>
1010 ( _ interactor: InteractorProtocol , request: InteractorRequest < Response > )
1111 {
1212 let key = String ( describing: request)
13- self . interactors [ key] = InteractorWrapper ( interactor: interactor)
13+ interactors [ key] = InteractorWrapper ( interactor: interactor)
1414 }
1515
1616 // MARK: Execute
1717
18- open func execute< Request: ErrorRequest > ( _ request: Request ) {
18+ func execute< Request: ErrorRequest > ( _ request: Request ) {
1919 let key = String ( describing: request)
2020 let optionalValue = interactors [ key]
2121
2222 guard let value = optionalValue else {
23- self . fireIntactorNotRegisterdError ( request)
23+ fireIntactorNotRegisterdError ( request)
2424 return
2525 }
2626
2727 guard let wrapper = value as? InteractorWrapper < Request > else {
28- self . fireIntactorMismatchError ( request)
28+ fireIntactorMismatchError ( request)
2929 return
3030 }
3131
@@ -34,19 +34,19 @@ open class InteractorExecuter {
3434
3535 // MARK: Error Handling
3636
37- fileprivate func fireErrorOnRequest( _ request: ErrorRequest , errorMessage: String ) {
37+ private func fireErrorOnRequest( _ request: ErrorRequest , errorMessage: String ) {
3838 let error = InteractorError ( message: errorMessage)
3939 request. onError ? ( error)
4040 }
4141
42- fileprivate func fireIntactorNotRegisterdError( _ request: ErrorRequest ) {
42+ private func fireIntactorNotRegisterdError( _ request: ErrorRequest ) {
4343 let message = " ACInteractor.ACInteractorExcuter: No Interactor is registered for this request! "
44- self . fireErrorOnRequest ( request, errorMessage: message)
44+ fireErrorOnRequest ( request, errorMessage: message)
4545 }
4646
47- fileprivate func fireIntactorMismatchError( _ request: ErrorRequest ) {
47+ private func fireIntactorMismatchError( _ request: ErrorRequest ) {
4848 let message = " ACInteractor.ACInteractorExcuter: Request does not match execute function of registered Interactor! "
49- self . fireErrorOnRequest ( request, errorMessage: message)
49+ fireErrorOnRequest ( request, errorMessage: message)
5050 }
5151
5252}
@@ -57,8 +57,8 @@ open class InteractorExecuter {
5757// Wrapper class for interactors.
5858// This class is required as long as Swift does not support generic protocol types as variable types.
5959// For instance:
60- // let x = Interactor<RequestType> does not work
61- // let x = InteractorWrapper<RequestType> does work
60+ // let x: Interactor<RequestType> does not work
61+ // let x: InteractorWrapper<RequestType> does work
6262
6363private class InteractorWrapper < Request> {
6464
0 commit comments