9
10
11
12
13
14
15
|
# File 'lib/rdbc.rb', line 9
def contract(contract_class)
old_new = self.method(:new)
(class << self; self; end).send(:define_method, :new) do |*args|
object = old_new.call(*args)
Rdbc::Decorator.new(object, contract_class.new)
end
end
|