D
Dmitry N Orlov
(Inspired by Test Driven Development of Kent Bek)
How Can I return from a class method object of the class ? Like this:
class Dollar
attr_reader :amount
def initialize(amount)
@amount = amount
end
def times(multiplier)
return Dollar.new(@amount * multiplier) #??????????
end
end
How Can I return from a class method object of the class ? Like this:
class Dollar
attr_reader :amount
def initialize(amount)
@amount = amount
end
def times(multiplier)
return Dollar.new(@amount * multiplier) #??????????
end
end