Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubydefine_methodSingle-choice MCQ

In Ruby 3.x, what is the visibility of a method created by `define_method` that appears right after a bare `private` statement in a class body?

class Vis private define_method(:secret) { "s" } end Vis.new.respond_to?(:secret) # => false