Skip to content

Commit

Permalink
Shorter variable names in UserDefaultsSoundFactory
Browse files Browse the repository at this point in the history
Issue #161
  • Loading branch information
eofster committed Mar 15, 2016
1 parent 4f11e49 commit 7cdabac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Telephone/CompositionRoot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class CompositionRoot: NSObject {
let interactorFactory = DefaultInteractorFactory(systemAudioDeviceRepository: audioDevices, userDefaults: userDefaults)

let userDefaultsSoundFactory = UserDefaultsSoundFactory(
soundConfigurationLoadInteractor: UserDefaultsRingtoneSoundConfigurationLoadInteractor(
interactor: UserDefaultsRingtoneSoundConfigurationLoadInteractor(
userDefaults: userDefaults,
systemAudioDeviceRepository: audioDevices
),
nsSoundToSoundAdapterFactory: NSSoundToSoundAdapterFactory()
factory: NSSoundToSoundAdapterFactory()
)

ringtonePlayback = ConditionalRingtonePlaybackInteractor(
Expand Down
12 changes: 6 additions & 6 deletions Telephone/UserDefaultsSoundFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
import UseCases

class UserDefaultsSoundFactory {
let soundConfigurationLoadInteractor: SoundConfigurationLoadInteractor
let nsSoundToSoundAdapterFactory: NSSoundToSoundAdapterFactory
let interactor: SoundConfigurationLoadInteractor
let factory: NSSoundToSoundAdapterFactory

init(soundConfigurationLoadInteractor: SoundConfigurationLoadInteractor, nsSoundToSoundAdapterFactory: NSSoundToSoundAdapterFactory) {
self.soundConfigurationLoadInteractor = soundConfigurationLoadInteractor
self.nsSoundToSoundAdapterFactory = nsSoundToSoundAdapterFactory
init(interactor: SoundConfigurationLoadInteractor, factory: NSSoundToSoundAdapterFactory) {
self.interactor = interactor
self.factory = factory
}
}

extension UserDefaultsSoundFactory: SoundFactory {
func createSound(observer observer: SoundObserver) throws -> Sound {
return try nsSoundToSoundAdapterFactory.createSound(configuration: try soundConfigurationLoadInteractor.execute(), observer: observer)
return try factory.createSound(configuration: try interactor.execute(), observer: observer)
}
}

0 comments on commit 7cdabac

Please sign in to comment.