class Alexandria::ExportFormat

Attributes

ext[R]
message[R]
name[R]

Public Class Methods

all() click to toggle source
# File lib/alexandria/export_format.rb, line 16
def self.all
  [
    new(_("Archived ONIX XML"), "onix.tbz2", :export_as_onix_xml_archive),
    new(_("Archived Tellico XML"), "tc", :export_as_tellico_xml_archive),
    new(_("BibTeX"), "bib", :export_as_bibtex),
    new(_("CSV list"), "csv", :export_as_csv_list),
    new(_("ISBN List"), "txt", :export_as_isbn_list),
    new(_("iPod Notes"), nil, :export_as_ipod_notes),
    new(_("HTML Web Page"), nil, :export_as_html, true)
  ]
end
new(name, ext, message, needs_preview = false) click to toggle source
# File lib/alexandria/export_format.rb, line 40
def initialize(name, ext, message, needs_preview = false)
  @name = name
  @ext = ext
  @message = message
  @needs_preview = needs_preview
end

Public Instance Methods

invoke(library, sort_order, filename, *args) click to toggle source
# File lib/alexandria/export_format.rb, line 28
def invoke(library, sort_order, filename, *args)
  sorted = ExportLibrary.new(library, sort_order)
  log.debug { "Exporting library sorted by #{sort_order}" }
  sorted.send(@message, filename, *args)
end
needs_preview?() click to toggle source
# File lib/alexandria/export_format.rb, line 34
def needs_preview?
  @needs_preview
end