Open lostapathy opened 5 years ago
I like it.
I did some, very minor, research trying to find other gems that already does this (rubytoolbox, google..) and found a few things that are vaguely related, but nothing that does what you mention.
ActiveRecord
https://github.com/acatighera/statistics (abandoned)Enumerable
https://github.com/thirtysixthspan/descriptive_statistics (abandoned)ActiveRecord
median extension https://github.com/ankane/active_medianIt might be something that would be useful and possible to maintain. I'll try experiment a bit first.
Thanks again @lostapathy I'll try to post back to this thread soon. (Be sure to @-mention me again here soon if I don't get back to you.)
@buren I experimented with this a bit before I put this in, and definitely think it's doable. I will try to turn that into a PR for you in the next couple days.
Would you have any interest in a PR that adds support for other aggregations, or would you rather leave the scope of this gem as-is?
It would be really awesome to be able to have (roughly):
Or perhaps have various helpers such as this to have a nicer, if more limited, DSL.