module DutyFree
An ActiveRecord
extension that simplifies importing and exporting of data stored in one or more models. Source and destination can be CSV, XLS, XLSX, ODT, HTML tables, or simple Ruby arrays.
Public Class Methods
Returns DutyFree's global configuration object, a singleton. These settings affect all threads. @api private
# File lib/duty_free.rb, line 116 def config @config ||= DutyFree::Config.instance yield @config if block_given? @config end
Switches DutyFree
on or off, for all threads. @api public
# File lib/duty_free.rb, line 82 def enabled=(value) DutyFree.config.enabled = value end
Returns `true` if DutyFree
is on, `false` otherwise. This is the on/off switch that affects all threads. Enabled by default. @api public
# File lib/duty_free.rb, line 89 def enabled? !!DutyFree.config.enabled end
Returns DutyFree's `::Gem::Version`, convenient for comparisons. This is recommended over `::DutyFree::VERSION::STRING`.
@api public
# File lib/duty_free.rb, line 97 def gem_version ::Gem::Version.new(VERSION::STRING) end
Get the DutyFree
serializer used by all threads. @api public
# File lib/duty_free.rb, line 109 def serializer DutyFree.config.serializer end
Set the DutyFree
serializer. This setting affects all threads. @api public
# File lib/duty_free.rb, line 103 def serializer=(value) DutyFree.config.serializer = value end
# File lib/duty_free.rb, line 123 def version VERSION::STRING end