class NotImplemented < Exception end class Recording def render raise NotImplemented end end class YouTubeRecording attr_accessor :vid def initialize link @vid = parse_vid link end def parse_vid link /\?v=(.{11})/.match(link)[1] end def render template = ERB.new(File.read('templates/youtube.html.erb'), trim_mode: '-') template.result binding end end class BandcampRecording attr_accessor :embed def initialize _embed @embed = _embed end def render @embed end end class SoundCloudRecording attr_accessor :embed def initialize _embed @embed = _embed end def render @embed end end