Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/multiblocks.rb
Constant Summary collapse
- CALLGROUPS_VERSION =
"0.1.0"
Instance Method Summary collapse
-
#callgroups ⇒ Object
Shows callgroups of the module (nb. callgroups are inherited).
-
#import_callgroups ⇒ Object
Creates copies of callgroups of ancestors in receiver.
Instance Method Details
#callgroups ⇒ Object
Shows callgroups of the module (nb. callgroups are inherited)
54 55 56 57 58 59 60 |
# File 'lib/multiblocks.rb', line 54 def callgroups h = {} ancestors.reverse.each {|m| h.merge!(m.instance_variable_get(:@callgroups) || {}) } h end |
#import_callgroups ⇒ Object
Creates copies of callgroups of ancestors in receiver. Use this for extending parents’ callgroups. Without it calling callgroup
allocates a fresh callgroup.
65 66 67 68 69 |
# File 'lib/multiblocks.rb', line 65 def import_callgroups @callgroups ||= {} @callgroups.merge! callgroups @callgroups = Marshal.load Marshal.dump(@callgroups) end |