Is there a class or other extension for Rails that allows more than the first few elements in a series (and the last)? These work:
[2,45,2,14,53,23,634,346,
You can just use square brackets:
list[6]
list[100]
There was a time when Rails added these, but there was a lot of controversy so most were removed. The only one of this experiment that remains is Array#forty_two
.
In activesupport, it does monkey patching few of these methods into Array class. If you really want more, you can take a look how to implement from activesupport:
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/array/access.rb