Exception: BezierCurve::DifferingDimensionError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/bezier_curve.rb

Overview

Indicates that the points do not all have the same number of dimensions, which makes them impossible to use.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDifferingDimensionError

Returns a new instance of DifferingDimensionError.



147
148
149
# File 'lib/bezier_curve.rb', line 147

def initialize
  super "All points must have the same number of dimensions"
end

Class Method Details

.check!(pointset) ⇒ Object

Raises:

  • (self)


150
151
152
153
# File 'lib/bezier_curve.rb', line 150

def self.check! pointset
  raise self if
    pointset[1..-1].any?{|pt| pointset[0].size != pt.size}
end