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

config() { |config| ... } click to toggle source

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
Also aliased as: configure
configure()
Alias for: config
enabled=(value) click to toggle source

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
enabled?() click to toggle source

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
gem_version() click to toggle source

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
serializer() click to toggle source

Get the DutyFree serializer used by all threads. @api public

# File lib/duty_free.rb, line 109
def serializer
  DutyFree.config.serializer
end
serializer=(value) click to toggle source

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
version() click to toggle source
# File lib/duty_free.rb, line 123
def version
  VERSION::STRING
end