Skip to content

Instantly share code, notes, and snippets.

@soulcutter
Last active November 5, 2017 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soulcutter/3af3bf93353b1f4d61b8a07652d76132 to your computer and use it in GitHub Desktop.
Save soulcutter/3af3bf93353b1f4d61b8a07652d76132 to your computer and use it in GitHub Desktop.
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