Module: Decors::Utils

Defined in:
lib/decors/utils.rb

Class Method Summary collapse

Class Method Details

.method_visibility(method) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/decors/utils.rb', line 4

def method_visibility(method)
    if method.owner.private_method_defined?(method.name)
        :private
    elsif method.owner.protected_method_defined?(method.name)
        :protected
    elsif method.owner.public_method_defined?(method.name)
        :public
    else
        fail ArgumentError, 'Unkwnown method'
    end
end