Class: Rohbau::Application::RuntimeWrapper

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

Class Method Summary collapse

Class Method Details

.wrap(&constructor) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rohbau/application.rb', line 4

def self.wrap(&constructor)
  wrapper = Class.new do
    def self.set_constructor(constructor)
      @constructor = constructor
      self
    end

    def self.new(*ignored_args)
      @constructor.call
    end
  end

  wrapper.set_constructor(constructor)
end