Method: MemoWise::InternalAPI.method_visibility
- Defined in:
- lib/memo_wise/internal_api.rb
.method_visibility(target, method_name) ⇒ :private, ...
Returns visibility of an instance method defined on class target.
160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/memo_wise/internal_api.rb', line 160 def self.method_visibility(target, method_name) if target.private_method_defined?(method_name) :private elsif target.protected_method_defined?(method_name) :protected elsif target.public_method_defined?(method_name) :public else raise ArgumentError, "#{method_name.inspect} must be a method on #{target}" end end |