Module: SITACObjects

Included in:
Figure
Defined in:
lib/sitac_objects.rb

Overview

utility function

Instance Method Summary collapse

Instance Method Details

#as_point(point) ⇒ Point

ensure a point is a Point object

Parameters:

  • point (Point, Array)

    the point to convert

Returns:

  • (Point)

    the point as a Point object



16
17
18
# File 'lib/sitac_objects.rb', line 16

def as_point(point)
  point.instance_of?(Point) ? point.to_p : Point.new('', point[0], point[1])
end