Skip to content

Instantly share code, notes, and snippets.

@duelinmarkers
Last active December 17, 2015 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duelinmarkers/5547247 to your computer and use it in GitHub Desktop.
Save duelinmarkers/5547247 to your computer and use it in GitHub Desktop.
module RapidFTR
module AddOns
def self.add_exporter(e)
exporters << e
end
def self.exporters
@exporters ||= []
end
ExportResult = Struct.new :data, :content_type, :file_ext
def self.add_importer i # if you ever invent such a thing
end
end
require 'rapidftr/add_ons'
class CPIMSExportTask
def export(children)
# Code...
RapidFTR::AddOns::ExportResult.new the_data, "application/pdf", "pdf"
end
end
RapidFTR::AddOns.add_exporter CPIMSExportTask
@duelinmarkers
Copy link
Author

Untested, so likely has mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment