merged/lib/merged.rb

18 lines
412 B
Ruby
Raw Normal View History

require "merged/version"
require "merged/engine"
module Merged
2022-12-08 15:34:20 +01:00
def self.load_data
# pre-load data
2022-12-17 11:15:26 +01:00
[OptionDefinition, CardStyle, SectionStyle , PageStyle,
Card , Section , Page , Image].each {|clazz| clazz.all }
2022-12-08 15:34:20 +01: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
end