8 9 10
# File 'lib/commercebank/monkey.rb', line 8 def binary map {|e| yield(e) ? [e, nil] : [nil, e]}.transpose.map {|a| a.compact} end
12 13 14 15 16 17 18 19
# File 'lib/commercebank/monkey.rb', line 12 def paramify hash = Hash.new hash.merge! pop if last.kind_of? Hash each {|e| hash[e] = true} hash end