Module: ActiveExport
- Defined in:
- lib/generators/active_export/install_generator.rb,
lib/active_export.rb,
lib/active_export/csv.rb,
lib/active_export/xml.rb,
lib/active_export/base.rb,
lib/active_export/yaml.rb,
lib/active_export/version.rb,
lib/active_export/configuration.rb
Overview
Defined Under Namespace
Modules: Generators
Classes: Base, Configuration, Csv, Xml, Yaml
Constant Summary
collapse
- VERSION =
"0.4.0"
Class Method Summary
collapse
Class Method Details
.[](key) ⇒ Object
38
39
40
|
# File 'lib/active_export.rb', line 38
def [](key)
source(key)
end
|
.clear! ⇒ Object
42
43
44
45
|
# File 'lib/active_export.rb', line 42
def clear!
@source = {}
true
end
|
.configuration ⇒ Object
Also known as:
config
Accessor for ActiveExport::Configuration
33
34
35
|
# File 'lib/active_export.rb', line 33
def configuration
@configuration ||= Configuration.new
end
|
28
29
30
|
# File 'lib/active_export.rb', line 28
def configure
yield configuration
end
|
.include_source?(key) ⇒ Boolean
66
67
68
|
# File 'lib/active_export.rb', line 66
def include_source?(key)
@configuration.sources.has_key?(key)
end
|
.load!(key) ⇒ Object
47
48
49
50
|
# File 'lib/active_export.rb', line 47
def load!
config.sources.each {|f| source(f) }
true
end
|
.reload! ⇒ Object
52
53
54
55
|
# File 'lib/active_export.rb', line 52
def reload!
clear!
load!
end
|
.source(key) ⇒ Object
57
58
59
60
61
62
63
64
|
# File 'lib/active_export.rb', line 57
def source(key)
if @configuration.always_reload
load!(key)
else
@sources ||= {}
@sources[key] ||= load!(key)
end
end
|