Module: PerfectShape::MultiPoint
- Included in:
- CubicBezierCurve, Line, Path, Polygon, QuadraticBezierCurve
- Defined in:
- lib/perfect_shape/multi_point.rb
Overview
Represents multi-point shapes like Line, Polygon, and Polyline
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
Instance Attribute Details
#points ⇒ Object
Returns the value of attribute points.
27 28 29 |
# File 'lib/perfect_shape/multi_point.rb', line 27 def points @points end |
Instance Method Details
#initialize(points: []) ⇒ Object
29 30 31 |
# File 'lib/perfect_shape/multi_point.rb', line 29 def initialize(points: []) self.points = points end |
#max_x ⇒ Object
57 58 59 |
# File 'lib/perfect_shape/multi_point.rb', line 57 def max_x points.map(&:first).max end |
#max_y ⇒ Object
61 62 63 |
# File 'lib/perfect_shape/multi_point.rb', line 61 def max_y points.map(&:last).max end |
#min_x ⇒ Object
49 50 51 |
# File 'lib/perfect_shape/multi_point.rb', line 49 def min_x points.map(&:first).min end |
#min_y ⇒ Object
53 54 55 |
# File 'lib/perfect_shape/multi_point.rb', line 53 def min_y points.map(&:last).min end |