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.



131
132
133
# File 'lib/bezier_curve.rb', line 131

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

Class Method Details

.check!(pointset) ⇒ Object



134
135
136
137
# File 'lib/bezier_curve.rb', line 134

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