I’m not sure if this is the right place to ask about this, so my apologies if it is not.
I am interested in writing a Gem that takes advantage of ActiveSupport durations, but I don’t want to require using core extensions in order to use my gem. I notice that there is a ActiveSupport::Duration class that I can use, but its constructor is not documented. That makes me feel that if to rely on it is to rely on an unpublished interface.
Would it make sense for me to submit a PR to add documentation for ActiveSupport::Duration constructor to make it more of an officially supported thing?
Thanks. I did not know about that gem. Looks very interesting (except for the use of floats for seconds ). The main reason I had been aiming for the use of ActiveSupport durations is because that makes it easier to cleanly integrate into Rails apps and the multitude of other apps that are using ActiveSupport already.
ActiveSupport::Duration uses floats for seconds too (if needed, try to execute 4.2.seconds in rails console). Few versions ago durations were (and still are) auxiliary things. Currently I’m trying to make them more self-sufficient in #16917 and #16919, but review process seems to be endless. So, I think it’s good idea to document constructor. Or may be even change it (now you should know all the parts and calculate their value in seconds to construct duration — inconvenient), but this requires consulting with someone from core team.
P.S> If you’re already using Active Support why do you ever worrying about core extensions? You have all of them already switched on in Rails app by default.