From: Derek Cannon Date: 2010-04-23T14:59:10+09:00 Subject: Re: Best way to write this method? If you guys need some better clarification as to what these methods do: Parameter explanation: Each hash passed into overlaps?(x,y) will have a key (day of the week) linked to an array of ranges (times through the day). E.g. x = { :monday => [1..3, 4..6], :wednesday => [1..3] } y = { :monday => [1..3], :wednesday => [4..5] } Methods explanation: These methods are used to make sure that no two hashes have conflicting times (ranges in the array for each key) on the same day (same key). In the above example, the overlaps? method would see that both x and y hashes have the same keys (meaning they're on the same days), so it would continue to investigate the values further. (If they didn't share at least one common day, their times could never conflict because they'd be on different days.) In the next step, the code compares every range in the array (of every key) of the two hashes, and ensures that no two times overlap on the same day. Does this make it any clearer? Or is no one answering this because I've made it as simple/Ruby-esque as it can get? Thanks, Derek -- Posted via http://www.ruby-forum.com/.