class Draught::Transformations::Proclike

Attributes

proclike[R]

Public Class Methods

new(proclike) click to toggle source
# File lib/draught/transformations/proclike.rb, line 11
def initialize(proclike)
  @proclike = proclike
end

Public Instance Methods

==(other) click to toggle source
# File lib/draught/transformations/proclike.rb, line 23
def ==(other)
  other.respond_to?(:proclike) && proclike == other.proclike
end
affine?() click to toggle source
# File lib/draught/transformations/proclike.rb, line 19
def affine?
  false
end
call(point) click to toggle source
# File lib/draught/transformations/proclike.rb, line 15
def call(point)
  point_from_tuple_or_point(proclike.call(point))
end
coalesce(_) click to toggle source
# File lib/draught/transformations/proclike.rb, line 31
def coalesce(_)
  raise TypeError, "non-Affine transforms cannot be coalesced"
end
flattened_transforms() click to toggle source
# File lib/draught/transformations/proclike.rb, line 27
def flattened_transforms
  [self]
end

Private Instance Methods

point_from_tuple_or_point(tuple_or_point) click to toggle source
# File lib/draught/transformations/proclike.rb, line 37
def point_from_tuple_or_point(tuple_or_point)
  return Point.new(*tuple_or_point) if tuple_or_point.respond_to?(:each)
  tuple_or_point
end