Sha256: d8357fffd8ca342a6c2a23fb006959e182a0e195437a8d8b06ca4d2e15719e36

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 Bytes

Contents

require_relative './common'

module Draught
  module Transformations
    class Composition
      include Transformations::Common

      attr_reader :transforms

      def initialize(transforms)
        @transforms = transforms
      end

      def call(point)
        transforms.inject(point) { |result_point, transform| transform.call(result_point) }
      end

      def affine?
        false
      end

      def to_transform
        self
      end

      def ==(other)
        other.transforms == transforms
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
draught-0.1.0 lib/draught/transformations/composition.rb