Module: Module::InstanceMethodVisibility

Included in:
Module
Defined in:
lib/module/instance_method_visibility.rb

Instance Method Summary collapse

Instance Method Details

#instance_method_visibility(name) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/module/instance_method_visibility.rb', line 10

def instance_method_visibility(name)
  if private_method_defined?(name)
    :private
  elsif protected_method_defined?(name)
    :protected
  elsif public_method_defined?(name)
    :public
  else
    raise(NoMethodError,
          "`#{name}' - not an instance method of `#{self.name}'")
  end
end