lib/active_object/array.rb in active_object-5.8.9 vs lib/active_object/array.rb in active_object-5.8.10
- old
+ new
@@ -219,9 +219,14 @@
def strip!
replace(strip)
end
+ def swap(from, to)
+ self[from], self[to] = self[to], self[from]
+ self
+ end
+
def to(position)
position >= 0 ? first(position + 1) : self[0..position]
end
# rubocop:disable Metrics/MethodLength