This might be really obvious but I can't find the answer.
How do you get the integer index from named order, like:
{ :first => 0, :second => 1, :third => 2, :fourth => 3 }
Is there something built in to Ruby or Rails that does this?
Thanks.
Update
Thanks for all your responses. Here's the solution I went with:
def index_for(position)
(0..4).to_a.send(position)
end
but arrays only support up to fifth, so it'll be limited to that.