Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/multiblocks.rb

Constant Summary collapse

CALLGROUPS_VERSION =
"0.1.0"

Instance Method Summary collapse

Instance Method Details

#callgroupsObject

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_callgroupsObject

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