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.



159
160
161
# File 'lib/bezier_curve.rb', line 159

def initialize
  super "You must supply a minimum of two points"
end

Class Method Details

.check!(pointset) ⇒ Object

Raises:

  • (self)


162
163
164
165
# File 'lib/bezier_curve.rb', line 162

def self.check! pointset
  raise self if
    pointset.size <= 1
end