Class: Alexandria::ExportFormat
- Inherits:
-
Object
- Object
- Alexandria::ExportFormat
- Extended by:
- GetText
- Includes:
- Logging, GetText
- Defined in:
- lib/alexandria/export_library.rb
Instance Attribute Summary collapse
-
#ext ⇒ Object
readonly
Returns the value of attribute ext.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Logging
Instance Attribute Details
#ext ⇒ Object (readonly)
Returns the value of attribute ext.
91 92 93 |
# File 'lib/alexandria/export_library.rb', line 91 def ext @ext end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
91 92 93 |
# File 'lib/alexandria/export_library.rb', line 91 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
91 92 93 |
# File 'lib/alexandria/export_library.rb', line 91 def name @name end |
Class Method Details
.all ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/alexandria/export_library.rb', line 98 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 |
Instance Method Details
#invoke(library, sort_order, filename, *args) ⇒ Object
110 111 112 113 114 115 116 117 118 |
# File 'lib/alexandria/export_library.rb', line 110 def invoke(library, sort_order, filename, *args) if sort_order sorted = SortedLibrary.new(library, sort_order) log.debug { "Exporting library sorted by #{sort_order}" } sorted.send(@message, filename, *args) else library.send(@message, filename, *args) end end |
#needs_preview? ⇒ Boolean
120 121 122 |
# File 'lib/alexandria/export_library.rb', line 120 def needs_preview? @needs_preview end |