Skip to content

Instantly share code, notes, and snippets.

@soulcutter soulcutter/urinal_game.rb
Last active Nov 5, 2017

Embed
What would you like to do?
Example of what object syntax could look like
bathroom.urinals.occupied.select { |urinal| urinal.adjacent.select(&:occupied?).any? }
Urinal = Struct.new(:is_occupied, :location) { def adjacent_urinals; location.adjacent_urinals; end }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.