lib/concerned.rb in concerned-0.1.1 vs lib/concerned.rb in concerned-0.1.2
- old
+ new
@@ -1,7 +1,27 @@
require 'concerned/module_ext'
module Concerned
+ def self.included(base)
+ base.extend MetaMethods
+ end
+
+ module MetaMethods
+ attr_writer :my_concerns, :my_shared_concerns
+
+ def all_my_concerns
+ my_concerns + my_shared_concerns
+ end
+
+ def my_concerns
+ @my_concerns ||= []
+ end
+
+ def my_shared_concerns
+ @my_shared_concerns ||= []
+ end
+ end
+
class << self
def require_shared concern
require_method "shared/#{concern.to_s.underscore}"
end
\ No newline at end of file