Module: Flexite
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/flexite.rb,
lib/flexite/flexy.rb,
lib/flexite/engine.rb,
lib/flexite/version.rb,
lib/flexite/nodes_hash.rb,
lib/flexite/cached_node.rb,
app/models/flexite/entry.rb,
app/models/flexite/config.rb,
lib/flexite/configuration.rb,
app/models/flexite/history.rb,
app/forms/flexite/entry/form.rb,
app/models/flexite/arr_entry.rb,
app/forms/flexite/config/form.rb,
app/models/flexite/bool_entry.rb,
app/services/flexite/data/new.rb,
app/forms/flexite/entry/array_form.rb,
app/helpers/flexite/configs_helper.rb,
app/helpers/flexite/entries_helper.rb,
app/models/flexite/history_attribute.rb,
app/factories/flexite/service_factory.rb,
app/helpers/flexite/application_helper.rb,
app/models/concerns/flexite/with_history.rb,
app/services/flexite/data/migrators/yaml.rb,
app/services/flexite/entry/create_service.rb,
app/services/flexite/entry/update_service.rb,
app/controllers/flexite/configs_controller.rb,
app/controllers/flexite/entries_controller.rb,
app/services/flexite/config/create_service.rb,
app/services/flexite/config/update_service.rb,
app/services/flexite/entry/destroy_service.rb,
app/controllers/flexite/histories_controller.rb,
app/services/flexite/entry/inner_processable.rb,
app/controllers/flexite/application_controller.rb,
app/services/flexite/entry/array_create_service.rb,
app/services/flexite/entry/array_update_service.rb,
app/services/flexite/entry/destroy_array_entry_service.rb
Defined Under Namespace
Modules: ApplicationHelper, ConfigsHelper, EntriesHelper, WithHistory
Classes: ActionService, ApplicationController, ArrEntry, BaseFactory, BaseForm, BoolEntry, CachedNode, Config, ConfigsController, Configuration, Engine, EntriesController, Entry, Flexy, HistoriesController, History, HistoryAttribute, IntEntry, NodesHash, ServiceFactory, StrEntry, SymEntry
Constant Summary
collapse
- VERSION =
'0.0.7'
- @@config =
Configuration.new
- @@loaded =
false
Class Method Summary
collapse
Class Method Details
.cache ⇒ Object
23
24
25
|
# File 'lib/flexite.rb', line 23
def cache
@@config.cache
end
|
.cached_nodes ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/flexite.rb', line 32
def cached_nodes
return unless Config.table_exists?
cache.fetch(@@config.root_cache_key) do
Config.where(config_id: nil).each_with_object(NodesHash.new) do |root, memo|
memo[root.name] = cache.fetch(root) do
CachedNode.new(root)
end
end
end
end
|
19
20
21
|
# File 'lib/flexite.rb', line 19
def configure
yield(@@config)
end
|
.reload_root_cache ⇒ Object
27
28
29
30
|
# File 'lib/flexite.rb', line 27
def reload_root_cache
cache.delete(@@config.root_cache_key)
cached_nodes
end
|