Ruby code below seems to be not so dry. Can you please help me reduce the code.
self.value = case self.type
when 'fast'
Increment.first.max_hours * Incrementor.first.fast_completion_day
when 'super_fast'
Increment.first.max_hours * Incrementor.first.super_fast_completion_day
when 'ludicrous'
Increment.first.max_hours * Incrementor.first.ludicrous_completion_day
else
Increment.first.max_hours * Incrementor.first.budget_completion_day
end
I think we can use Ruby metaprogamming here to reduce the code. But I am not very good with ruby meta programming at the moment.