Sha256: 601418a7938f1e92cf8fb80dd14c7ac2efb78dadce97bc8fafb28cca7b5e49ce
Contents?: true
Size: 591 Bytes
Versions: 13
Compression:
Stored size: 591 Bytes
Contents
module Ludy # fib = 0 : 1 : [x+y | (x, y) <- zip fib (tail fib)] # combos = List[->(x,y){[x,y]}, 0..1, 2..3] class List # :nodoc: private :initialize class << self def [] target, *args raise ArgumentError.new("you need at least #{target.arity} arguments(sources) for #{target}") if args.size < target.arity sources = args[0...target.arity] conditions = args[target.arity..-1] create_array sources, conditions end private def create_array sources, conditions sources.traspose.flatten end end end end
Version data entries
13 entries across 13 versions & 2 rubygems