Sha256: f8428258d1b21ffbdd95bcd37d776b29cb76100bc37054318295614c93c1c4b5
Contents?: true
Size: 520 Bytes
Versions: 13
Compression:
Stored size: 520 Bytes
Contents
# -*- coding: utf-8 -*- 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
13 entries across 13 versions & 1 rubygems