Class: Jouba::Aggregate
- Inherits:
-
Module
- Object
- Module
- Jouba::Aggregate
- Defined in:
- lib/jouba/aggregate.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #after_included(object, mod) ⇒ Object
-
#initialize(options = {}) ⇒ Aggregate
constructor
A new instance of Aggregate.
Constructor Details
#initialize(options = {}) ⇒ Aggregate
Returns a new instance of Aggregate.
8 9 10 11 12 13 14 15 16 |
# File 'lib/jouba/aggregate.rb', line 8 def initialize( = {}) @options = tap do |mod| mod.define_singleton_method :included do |object| super(object) after_included(object, mod) end end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/jouba/aggregate.rb', line 6 def @options end |
Instance Method Details
#after_included(object, mod) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/jouba/aggregate.rb', line 18 def after_included(object, mod) object.extend(ClassMethods) object.send :include, InstanceMethods object.send :include, Wisper::Publisher object.define_singleton_method :__module_options__ do mod. end end |