class Exporter::Exporter

Public Class Methods

export(data, options) click to toggle source
# File lib/exporter/exporter.rb, line 3
def self.export(data, options)
  document = exporter.process(data, options)
  raise TypeError.new('process method must return an Document object') unless document.kind_of? Document
  document
end
exporter() click to toggle source
# File lib/exporter/exporter.rb, line 9
def self.exporter
  @exporter ||= self.new
end

Protected Instance Methods

is_active_record?(data, options) click to toggle source
# File lib/exporter/exporter.rb, line 18
def is_active_record?(data, options)
  (data.kind_of? ActiveRecord::Relation) || (data.kind_of?(Array) && data[0].kind_of?(ActiveRecord::Base))
end
process(data, options) click to toggle source
# File lib/exporter/exporter.rb, line 14
def process(data, options)
  raise NotImplementedError.new("You must implement this process method.")
end