2022-11-28 19:22:50 +02:00
|
|
|
require "merged/version"
|
|
|
|
require "merged/engine"
|
|
|
|
|
|
|
|
module Merged
|
2022-11-30 13:21:06 +02:00
|
|
|
|
2022-12-08 16:34:20 +02:00
|
|
|
def self.load_data
|
2022-12-10 20:29:31 +02:00
|
|
|
# pre-load data
|
2022-12-17 12:15:26 +02:00
|
|
|
[OptionDefinition, CardStyle, SectionStyle , PageStyle,
|
|
|
|
Card , Section , Page , Image].each {|clazz| clazz.all }
|
2022-12-08 16:34:20 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.load_from( kind , path )
|
|
|
|
return unless File.exists?(path)
|
|
|
|
clazz = "Merged::#{kind.camelcase}".constantize
|
|
|
|
clazz.load(YAML.load_file( path ))
|
|
|
|
end
|
2022-11-28 19:22:50 +02:00
|
|
|
end
|