Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubysend and public_sendSingle-choice MCQ

Can send be used to invoke a private writer (setter) method, and what is the correct syntax?

class W def initialize @x = 0 end private def x=(v) @x = v end public def x @x end end w = W.new # set @x to 42 through the private writer