Module: Resugan::ObjectHelpers::ClassMethods

Defined in:
lib/resugan/object_helpers.rb

Instance Method Summary collapse

Instance Method Details

#attach_hook(method, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/resugan/object_helpers.rb', line 8

def attach_hook(method, options = {})
  alias_method "_resugan_orig_#{method}".to_sym, method.to_sym

  define_method(method.to_sym) do |*args|
    resugan options[:namespace] do
      send("_resugan_orig_#{method}".to_sym, *args)
    end
  end
end