I cannot see the value of the instance variable @model when I call the lambda @description. Is this possible? I only see " is very good." when I call show_description. Thanks in advance.
class Car
def initialize(model)
@model = model
end
def description
@description = lambda{yield}
end
def show_description
@description.call
end
end
c = Car.new("Ford")
c.description{"#{@model} is very good."}
puts c.show_description # => " is very good."