Gistlib Logo

gistlib

other ruby categories

each_cons code snippets in ruby

what is wrong? `series = struct.new(:strng) { def slices(n) n > @strng.length ? argumenterror : @strng.each_char.each_cons(n).map(&:join) end }` in ruby

gistlibby LogSnag