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



119
120
121
# File 'lib/bezier_curve.rb', line 119

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

Class Method Details

.check!(pointset) ⇒ Object



122
123
124
125
# File 'lib/bezier_curve.rb', line 122

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