-
-
Save steveklabnik/3853850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Audio < ActiveRecord::Base | |
def self.sync! | |
[Audio::ProgramAudio, Audio::DirectAudio, Audio::EncoAudio].each do |klass| | |
klass.sync! | |
end | |
end | |
class EncoAudio < Audio | |
def self.sync! | |
AudioSyncher.new(foo, bar).sync_awaiting_audio_if_file_exists! | |
end | |
end | |
class ProgramAudio < Audio | |
def self.sync! | |
# do other stuff | |
end | |
end | |
class DirectAudio < Audio | |
def self.sync! | |
AudioSyncher.new(foo, bar).sync_awaiting_audio_if_file_exists! | |
end | |
end | |
class UploadedAudio < Audio | |
# no sync method | |
end | |
# | |
end | |
class AudioSyncher | |
def initialize(foo, bar) | |
... | |
end | |
def sync_awaiting_audio_if_file_exists! | |
... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment