class PlexSymlinker::FileTypes::AudioFile

Attributes

path[R]

Public Class Methods

from_path(path) click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 19
def from_path(path)
  extension = File.extname(path)[1..-1]
  registered_types[extension.to_s]&.new(path) || fail(ArgumentError, "No type handler registered for extension '#{extension}'")
end
new(path) click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 27
def initialize(path)
  @path = path
end
register_type(extension, klass) click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 9
def register_type(extension, klass)
  registered_types[extension.to_s] = klass
end
registered_types() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 5
def registered_types
  @registered_types ||= {}
end
tag_reader(method_name, tag) click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 13
def tag_reader(method_name, tag)
  define_method(method_name) do
    tags[tag.to_s]
  end
end

Public Instance Methods

album() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 35
def album
  fail NotImplementedError
end
album_artist() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 55
def album_artist
  fail NotImplementedError
end
artist() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 51
def artist
  fail NotImplementedError
end
genre() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 39
def genre
  fail NotImplementedError
end
tags() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 31
def tags
  fail NotImplementedError
end
title() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 43
def title
  fail NotImplementedError
end
track_number() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 59
def track_number
  fail NotImplementedError
end
year() click to toggle source
# File lib/plex_symlinker/file_types/audio_file.rb, line 47
def year
  fail NotImplementedError
end