Module: PerfectShape::MultiPoint
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: nil) ⇒ Object
29 30 31 |
# File 'lib/perfect_shape/multi_point.rb', line 29 def initialize(points: nil) self.points = points || [] end |
#max_x ⇒ Object
51 52 53 |
# File 'lib/perfect_shape/multi_point.rb', line 51 def max_x points.map(&:first).max end |
#max_y ⇒ Object
55 56 57 |
# File 'lib/perfect_shape/multi_point.rb', line 55 def max_y points.map(&:last).max end |
#min_x ⇒ Object
43 44 45 |
# File 'lib/perfect_shape/multi_point.rb', line 43 def min_x points.map(&:first).min end |
#min_y ⇒ Object
47 48 49 |
# File 'lib/perfect_shape/multi_point.rb', line 47 def min_y points.map(&:last).min end |