1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

fix visibility bug on 1.9

This commit is contained in:
Ryan Fitzgerald 2011-10-25 21:39:35 -07:00
parent 79382dca54
commit ecaed39da4

View file

@ -238,11 +238,11 @@ class Pry
# @return [Symbol] The visibility of the method. May be `:public`, # @return [Symbol] The visibility of the method. May be `:public`,
# `:protected`, or `:private`. # `:protected`, or `:private`.
def visibility def visibility
@visibility ||= if owner.public_instance_methods.include?(name) @visibility ||= if owner.public_instance_methods.any? { |m| m.to_s == name }
:public :public
elsif owner.protected_instance_methods.include?(name) elsif owner.protected_instance_methods.any? { |m| m.to_s == name }
:protected :protected
elsif owner.private_instance_methods.include?(name) elsif owner.private_instance_methods..any? { |m| m.to_s == name }
:private :private
else else
:none :none