Sha256: db5cd8513ad00dc5c07e3d006c097d5df4854c68820a88684730f900713c270b
Contents?: true
Size: 521 Bytes
Versions: 1
Compression:
Stored size: 521 Bytes
Contents
#!/usr/bin/env ruby # -*- encoding: utf-8 -*- # Copyright muflax <mail@muflax.com>, 2013 # License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html> class Array def triangle return to_enum(:triangle) unless block_given? self.each.with_index do |a, ai| self.each.with_index do |b, bi| next if bi < ai yield [a, b] end end end def first ; self[0] ; end def second ; self[1] ; end def third ; self[2] ; end def fourth ; self[3] ; end def fifth ; self[4] ; end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
muflax-0.3.4 | lib/muflax/array.rb |