Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Array
- # add more as you see fit
- ORDERS = %w(second third fourth fifth sixth seventh eighth ninth tenth)
- ORDERS.each_with_index do |ord,i|
- define_method "#{ord}" do
- self[i+1]
- end
- end
- end
Add Comment
Please, Sign In to add comment