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

Given a class with a protected method, what is the result of `a.send(:balance)` versus `a.public_send(:balance)`?

class Account def initialize(b) = @b = b protected def balance = @b end a = Account.new(100) a.send(:balance) # (1) a.public_send(:balance) # (2)