lib/coactive/config.rb in coactive-0.1.0 vs lib/coactive/config.rb in coactive-0.1.1
- old
+ new
@@ -9,11 +9,16 @@
use_cache: true,
lookup_superclass_for_object: true,
lookup_superclass_until: ['ActiveRecord::Base', 'ActiveModel::Base'],
}
- def initialize
+ attr_accessor :data
+
+ def initialize(attrs = {})
@data = DEFAULTS.deep_dup
+ attrs.each do |key, value|
+ send("#{key}=", value)
+ end
end
DEFAULTS.keys.each do |key|
define_method "#{key}" do
@data[key]