Class: Woodhouse::MixinRegistry

Inherits:
Registry
  • Object
show all
Defined in:
lib/woodhouse/mixin_registry.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) classes



5
6
7
# File 'lib/woodhouse/mixin_registry.rb', line 5

def classes
  @classes ||= {}
end

+ (Object) register(klass)



9
10
11
# File 'lib/woodhouse/mixin_registry.rb', line 9

def register(klass)
  register_worker klass.name, klass
end

+ (Object) register_worker(class_name, klass)



13
14
15
# File 'lib/woodhouse/mixin_registry.rb', line 13

def register_worker(class_name, klass)
  classes[class_name.to_s] = klass
end

Instance Method Details

- (Object) [](worker)



19
20
21
# File 'lib/woodhouse/mixin_registry.rb', line 19

def [](worker)
  Woodhouse::MixinRegistry.classes[worker.to_s]
end

- (Object) each(&blk)



23
24
25
# File 'lib/woodhouse/mixin_registry.rb', line 23

def each(&blk)
  Woodhouse::MixinRegistry.classes.each &blk
end