Module: Domain::Reuse::Helpers

Defined in:
lib/domain/factory/reuse.rb

Instance Method Summary collapse

Instance Method Details

#recoat(*methods) ⇒ Object



42
43
44
45
46
# File 'lib/domain/factory/reuse.rb', line 42

def recoat(*methods)
  methods.each do |m|
    define_method(m){|*args, &bl| self.class.new reused_instance.send(m, *args, &bl)}
  end
end

#reuse(*methods) ⇒ Object



36
37
38
39
40
# File 'lib/domain/factory/reuse.rb', line 36

def reuse(*methods)
  methods.each do |m|
    define_method(m){|*args, &bl| reused_instance.send(m, *args, &bl)}
  end
end