Module: Draught::Pointlike

Included in:
CubicBezier, Curve, Point
Defined in:
lib/draught/pointlike.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

Raises:

  • (NotImplementedError)


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

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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_typeObject

Raises:

  • (NotImplementedError)


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

#pointsObject



31
32
33
# File 'lib/draught/pointlike.rb', line 31

def points
  [self]
end

#transform(transformer) ⇒ Object

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

#xObject

Raises:

  • (NotImplementedError)


3
4
5
# File 'lib/draught/pointlike.rb', line 3

def x
  raise NotImplementedError, "including classes must return an x value"
end

#yObject

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/draught/pointlike.rb', line 7

def y
  raise NotImplementedError, "including classes must return an y value"
end