class Alexandria::ImportFilter

Attributes

message[R]
name[R]
patterns[R]

Public Class Methods

all() click to toggle source
# File lib/alexandria/import_library.rb, line 19
def self.all
  [
    new(_("Autodetect"), ["*"], :import_autodetect),
    new(_("Archived Tellico XML (*.bc, *.tc)"),
        ["*.tc", "*.bc"], :import_as_tellico_xml_archive),
    new(_("ISBN List (*.txt)"), ["*.txt"], :import_as_isbn_list),
    new(_("GoodReads CSV"), ["*.csv"], :import_as_csv_file)
  ]
end
new(name, patterns, message) click to toggle source
# File lib/alexandria/import_library.rb, line 45
def initialize(name, patterns, message)
  @name = name
  @patterns = patterns
  @message = message
end

Public Instance Methods

invoke(library_name, filename) click to toggle source
# File lib/alexandria/import_library.rb, line 37
def invoke(library_name, filename)
  log.debug { "Selected: #{@message} -- #{library_name} -- #{filename}" }
  Library.send(@message, library_name, filename,
               @on_iterate_cb, @on_error_cb)
end
on_error(&on_error_cb) click to toggle source
# File lib/alexandria/import_library.rb, line 33
def on_error(&on_error_cb)
  @on_error_cb = on_error_cb
end
on_iterate(&on_iterate_cb) click to toggle source
# File lib/alexandria/import_library.rb, line 29
def on_iterate(&on_iterate_cb)
  @on_iterate_cb = on_iterate_cb
end