Module: Draught::Pointlike
- Included in:
- CubicBezier, Curve, Point
- Defined in:
- lib/draught/pointlike.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #approximates?(other, delta) ⇒ Boolean
- #point_type ⇒ Object
- #points ⇒ Object
- #transform(transformer) ⇒ Object
- #translate(vector) ⇒ Object
- #x ⇒ Object
- #y ⇒ Object
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/draught/pointlike.rb', line 15 def ==(other) raise NotImplementedError, "including classes must implement equality checking. It's assumed other point_types are always unequal" end |
#approximates?(other, delta) ⇒ Boolean
19 20 21 |
# File 'lib/draught/pointlike.rb', line 19 def approximates?(other, delta) raise NotImplementedError, "including classes must implement approximate equality checking. It's assumed other point_types are always unequal" end |
#point_type ⇒ Object
11 12 13 |
# File 'lib/draught/pointlike.rb', line 11 def point_type raise NotImplementedError, "including classes must return a Symbol with their point type" end |
#points ⇒ Object
31 32 33 |
# File 'lib/draught/pointlike.rb', line 31 def points [self] end |
#transform(transformer) ⇒ Object
27 28 29 |
# File 'lib/draught/pointlike.rb', line 27 def transform(transformer) raise NotImplementedError, "including classes must return a new instance transformed by the Affine transform or lambda Point-based transform supplied" end |
#translate(vector) ⇒ Object
23 24 25 |
# File 'lib/draught/pointlike.rb', line 23 def translate(vector) raise NotImplementedError, "including classes must return a new instance translated by the vector arg" end |
#x ⇒ Object
3 4 5 |
# File 'lib/draught/pointlike.rb', line 3 def x raise NotImplementedError, "including classes must return an x value" end |
#y ⇒ Object
7 8 9 |
# File 'lib/draught/pointlike.rb', line 7 def y raise NotImplementedError, "including classes must return an y value" end |