include::../description.adoc[]

== Noncompliant Code Example

----
class A
    def mymethod
        puts "I got called"
    end
    private :mymethod
end

a = A.new()
# => false
puts a.respond_to?(:mymethod)

class << a
    public :mymethod # NonCompliant: method was private
end
# => true
puts a.respond_to?(:mymethod)

b = A.new()
# => false
puts b.respond_to?(:mymethod)

A.class_eval do
    public :mymethod # NonCompliant: method was private
end

c = A.new()
# => true
puts c.respond_to?(:mymethod)
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
