Module: DutyFree
- Defined in:
- lib/duty_free/util.rb,
lib/duty_free/column.rb,
lib/duty_free/config.rb,
lib/duty_free/extensions.rb,
lib/duty_free/version_number.rb,
lib/duty_free/serializers/json.rb,
lib/duty_free/serializers/yaml.rb,
lib/duty_free/suggest_template.rb,
lib/duty_free/frameworks/cucumber.rb,
lib/duty_free/frameworks/rails/engine.rb,
lib/generators/duty_free/model_generator.rb,
lib/duty_free/frameworks/rails/controller.rb,
lib/generators/duty_free/install_generator.rb,
lib/duty_free.rb
Overview
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.
Defined Under Namespace
Modules: Cucumber, Extensions, Rails, Serializers, SuggestTemplate, Util, VERSION Classes: Column, Config, InstallGenerator, LessThanHalfAreMatchingColumnsError, ModelGenerator, NoUniqueColumnError
Class Method Summary collapse
-
.config {|@config| ... } ⇒ Object
(also: configure)
private
Returns DutyFree’s global configuration object, a singleton.
-
.enabled=(value) ⇒ Object
Switches DutyFree on or off, for all threads.
-
.enabled? ⇒ Boolean
Returns ‘true` if DutyFree is on, `false` otherwise.
-
.gem_version ⇒ Object
Returns DutyFree’s ‘::Gem::Version`, convenient for comparisons.
-
.serializer ⇒ Object
Get the DutyFree serializer used by all threads.
-
.serializer=(value) ⇒ Object
Set the DutyFree serializer.
- .version ⇒ Object
Class Method Details
.config {|@config| ... } ⇒ Object Also known as: configure
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns DutyFree’s global configuration object, a singleton. These settings affect all threads.
116 117 118 119 120 |
# File 'lib/duty_free.rb', line 116 def config @config ||= DutyFree::Config.instance yield @config if block_given? @config end |
.enabled=(value) ⇒ Object
Switches DutyFree on or off, for all threads.
82 83 84 |
# File 'lib/duty_free.rb', line 82 def enabled=(value) DutyFree.config.enabled = value end |
.enabled? ⇒ Boolean
Returns ‘true` if DutyFree is on, `false` otherwise. This is the on/off switch that affects all threads. Enabled by default.
89 90 91 |
# File 'lib/duty_free.rb', line 89 def enabled? !!DutyFree.config.enabled end |
.gem_version ⇒ Object
Returns DutyFree’s ‘::Gem::Version`, convenient for comparisons. This is recommended over `::DutyFree::VERSION::STRING`.
97 98 99 |
# File 'lib/duty_free.rb', line 97 def gem_version ::Gem::Version.new(VERSION::STRING) end |
.serializer ⇒ Object
Get the DutyFree serializer used by all threads.
109 110 111 |
# File 'lib/duty_free.rb', line 109 def serializer DutyFree.config.serializer end |