lib/geometry/point_iso.rb in geometry-6.4 vs lib/geometry/point_iso.rb in geometry-6.5
- old
+ new
@@ -89,9 +89,21 @@
else
[min(*args), max(*args)]
end
end
+ # Returns a new {Point} with the given number of elements removed from the end
+ # @return [Point] the popped elements
+ def pop(count=1)
+ Point[Array.new(count, @value)]
+ end
+
+ # Removes the first element and returns it
+ # @return [Point] the shifted elements
+ def shift(count=1)
+ Point[Array.new(count, @value)]
+ end
+
# @group Accessors
# @param i [Integer] Index into the {Point}'s elements
# @return [Numeric] Element i (starting at 0)
def [](i)
@value