Exception: BezierCurve::InsufficientPointsError

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

Overview

Indicates that there aren’t enough control points; minimum of two for a first-degree bezier.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInsufficientPointsError

Returns a new instance of InsufficientPointsError.



143
144
145
# File 'lib/bezier_curve.rb', line 143

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

Class Method Details

.check!(pointset) ⇒ Object



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

def self.check! pointset
  raise new.tap{|e|e.backtrace.shift} if
    pointset.size <= 1
end