lib/usable.rb in usable-3.7.1 vs lib/usable.rb in usable-3.8.0
- old
+ new
@@ -86,9 +86,16 @@
base.extend(Usable) unless base.respond_to?(:usables)
Usable.copy_usables(self, base)
super
end
+ def define_usable_accessors
+ usables.to_h.keys.each do |key|
+ define_singleton_method(key) { usables[key] }
+ define_singleton_method("#{key}=") { |new_val| usables[key] = new_val }
+ end
+ end
+
def usables
@usables ||= Config.new
end
attr_writer :usables