This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
NewerOlder