Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Forked from bricker/audio.rb
Created October 8, 2012 17:45
Show Gist options
  • Save steveklabnik/3853850 to your computer and use it in GitHub Desktop.
Save steveklabnik/3853850 to your computer and use it in GitHub Desktop.
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