Exception: BezierCurve::ZeroDimensionError

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

Overview

Indicates an error where the control points are in zero dimensions. Sounds silly, but you never know, when software is generating the points.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeZeroDimensionError

Returns a new instance of ZeroDimensionError.



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

def initialize
  super "Points given must have at least one dimension"
end

Class Method Details

.check!(pointset) ⇒ Object

Raises:

  • (self)


138
139
140
141
# File 'lib/bezier_curve.rb', line 138

def self.check! pointset
  raise self if
    pointset[0].size == 0
end