lib/usable.rb in usable-3.2.0 vs lib/usable.rb in usable-3.3.0

- old
+ new

@@ -4,33 +4,32 @@ require 'usable/version' require 'usable/mod_extender' require 'usable/config' module Usable - def self.extended(base) - base.class_eval do - def usable_method(method_name) - self.class.usable_method(self, method_name) - end - end if base.is_a? Class # Define an instance level version of +usables+ base.class_eval do def usables self.class.usables end + + def usable_method(method_name) + self.class.usable_method(self, method_name) + end end - else - # Define +config+ when added to a module + end + + unless base.respond_to?(:config) base.instance_eval do def config(&block) if block usables.instance_eval &block else usables end - end unless defined? config + end end end end def usables