In this class get_tax
method return string is missing interpolation for the @name
instance variable.
class TaxCalculator
def initialize(name, &block)
@name, @block = name, block
end
def get_tax(amount)
"#@name on #{amount} = #{ @block.call(amount) }"
end
end
Should be:
def get_tax(amount)
"#{@name} on #{amount} = #{ @block.call(amount) }"
end