Challenge 1: Dynamic Dispatch With send — Solution class Calculator def add(a, b) a + b end def subtract(a, b) a - b end def multiply(a, b) a * b end def calculate(operation, a, b) return nil unless respond_to?(operation) send(operation, a, b) end end calc = Calculator.new puts calc.calculate(:add, 4, 5) puts calc.calculate(:multiply, 3, 6) puts calc.calculate(:divide, 10, 2).inspect =begin Output: 9 18 nil Notes: - calculate(operation, a, b) accepts the operation as a symbol and checks respond_to?(operation) before attempting to call it at all. - :divide was never defined on Calculator, so respond_to?(:divide) is false, and calculate returns nil immediately instead of raising a NoMethodError. - send(operation, a, b) is only reached once respond_to? has already confirmed the method exists, which is the safe, idiomatic way to pair the two together. =end