Class: Woodhouse::Extension

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

Overview

Implements a very basic registry for Woodhouse extensions. This is a Class rather than a Module because it will eventually be used to provide a more structured approach than the one Woodhouse::Progress uses.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.registryObject

Returns the value of attribute registry.



8
9
10
# File 'lib/woodhouse/extension.rb', line 8

def registry
  @registry
end

Class Method Details

.install_extension(name, configuration, opts = {}, &blk) ⇒ Object



14
15
16
17
18
# File 'lib/woodhouse/extension.rb', line 14

def install_extension(name, configuration, opts = {}, &blk)
  if ext = registry[name]
    ext.install_extension(configuration, opts, &blk)
  end
end

.register(name, extension) ⇒ Object



10
11
12
# File 'lib/woodhouse/extension.rb', line 10

def register(name, extension)
  registry[name] = extension
end