This is an extension to my previous tip about moving elements in ruby arrays around. In fact, this is yet another mixin that only has one line of real code, and even though it's quite obvious I thought I'd post it here.
# Adds the ability to reoder elements by name, # it requires the object extended # to support the Reorderable module and have # a #index_of method module NameReorderable # Moves an element around an orderable # list by its name def move_by_name(name, to) move(index(name), to) end end

Comments
supplynflshop
thank you for sharing
http://www.supplynflshop.com
HaMsi
http://charlotte.onedoordown.com/cms/blogs/entry/information-
http://charlotte.onedoordown.com/cms/blogs/entry/Accepting-
http://charlotte.onedoordown.com/cms/blogs/entry/mainland
http://charlotte.onedoordown.com/cms/blogs/entry/outFapiao-
http://charlotte.onedoordown.com/cms/blogs/entry/generational-
http://charlotte.onedoordown.com/cms/blogs/entry/expected-
http://charlotte.onedoordown.com/cms/blogs/entry/working-
http://babblefishsn.com/blogs/entry/Security
http://babblefishsn.com/blogs/entry/accommodating
http://babblefishsn.com/blogs/entry/annual
http://babblefishsn.com/blogs/entry/community
http://babblefishsn.com/blogs/entry/innovative
http://babblefishsn.com/blogs/entry/massage
http://babblefishsn.com/blogs/entry/Korean
Post new comment