Module: MethodWrapper::ClassMethods

Defined in:
lib/method_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#include(*modules) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/method_wrapper.rb', line 26

def include(*modules)
  super

  @__wrapped_methods.each do |k, v|
    __wrap_method!(k, v)
  end
end

#method_added(name) ⇒ Object



20
21
22
23
24
# File 'lib/method_wrapper.rb', line 20

def method_added(name)
  return if @disable_method_added_hook

  new_added_method_has_in_wrpped_methods(name)
end

#wrap_methods(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/method_wrapper.rb', line 8

def wrap_methods(params)
  method_names, feature = params.first
  method_names = [method_names] unless method_names.instance_of? Array

  method_names.each do |name|
    feature_name = feature_method_name(name, feature)
    @__wrapped_methods[name] = feature_name

    __wrap_method!(name, feature_name)
  end
end