Skip to content

Instantly share code, notes, and snippets.

View david's full-sized avatar

David Leal david

View GitHub Profile
@david
david / gist:3247739
Created August 3, 2012 13:34
Lunacy? Or OO?
# Deciding how to handle a collection based on its size.
#
# Inspired by http://silkandspinach.net/2012/07/06/hexagonal-rails-hiding-the-finders/
#
# See below for usage
module Demux
def demux(demux, outputs = nil, &block)
if outputs && block_given?
raise ArgumentError, "Pass either a block or an object, not both"
We couldn’t find that file to show.