Hacker News new | past | comments | ask | show | jobs | submit login

Not quite, the point is that the caller doesn't care how much the loyalty bonus is, only that the bonus it is awarding is for loyalty.

The value of the bonus then gets captured in the domain object. If there is enough related logic to justify having a loyalty bonus object, then you might have

    account.award(LoyaltyBonus.new)
Or, if we're going to start slicing things up like this, we might go for:

    LoyaltyBonus.award_to(account)



Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: