Sha256: 02bf3039a077f66c093778736d4fbfe694892455deba362cfc95b7c0752db5b8
Contents?: true
Size: 494 Bytes
Versions: 12
Compression:
Stored size: 494 Bytes
Contents
require 'rays/ext' module Rays class Polyline include Enumerable def initialize(*points, loop: false) setup points, loop end def transform(matrix = nil, loop: loop?, &block) points = to_a points = points.map {|point| matrix * point} if matrix points = block.call points if block self.class.new(*points, loop: loop) end def inspect() "#<Rays::Polyline #{to_a.join ', '}, loop: #{loop?}>" end end# Polyline end# Rays
Version data entries
12 entries across 12 versions & 1 rubygems