Allow to pass a timestamp when counter is incremented#14
Allow to pass a timestamp when counter is incremented#14jakubkosinski wants to merge 1 commit intotrvsdnn:masterfrom
Conversation
|
I'm gonna think on this one a bit. I don't like the timestamp as a third argument for some reason. Maybe an optional third Hash argument – or maybe a different method when you're providing a timestamp (as proposed in #10). Obviously it's useful to be able to seed/migrate stat data, but it's such a one-time thing that it feels a little odd to integrate it so tightly into the standard API. |
|
Well, you're right, it's not the best solution, especially when there are multiple optional arguments. I don't think different method is really needed here, optional hash (or keyword arguments for ruby 2.0) sounds better for me. But I'd go with moving |
|
Yeah, I could get behind that. I think it's simple enough when the value is the only optional argument and it also looks pretty close to a lot of other |
I though it should be nice to have possibility to add custom timestamp to counter when incrementing it's value (e.g. to be able to populate the data or migrate from other storage). In my implementation, you can pass a timestamp as
Von.incrementargument.Time.nowis assumed when timestamp is not present.Related issue: #10