lib/knowledge_base/configuration.rb in knowledge_base-0.1.0 vs lib/knowledge_base/configuration.rb in knowledge_base-0.2.0

- old
+ new

@@ -1,23 +1,16 @@ module KnowledgeBase class Configuration - configs = { - storage: :file, - categories_path: 'categories', - articles_path: 'articles' - } + attr_accessor :categories_path, :articles_path, :text_image_uploader, + :image_image_uploader, :gallery_image_uploader, :list_image_uploader, :section_styles - configs.each do |config, default| - attr_writer config - - define_method config do - value = instance_variable_get "@#{config}" - - if value.nil? - default - else - value - end - end + def initialize + @categories_path = 'categories' + @articles_path = 'articles' + @text_image_uploader = KnowledgeBase::ImageUploader + @image_image_uploader = KnowledgeBase::ImageUploader + @gallery_image_uploader = KnowledgeBase::ImageUploader + @list_image_uploader = KnowledgeBase::ImageUploader + @section_styles = { } end end end