lib/active_object/array.rb in active_object-1.2.0 vs lib/active_object/array.rb in active_object-1.2.1
- old
+ new
@@ -2,14 +2,22 @@
def delete_first
self[1..-1]
end
+ def delete_first!
+ replace(delete_first)
+ end
+
def delete_last
self[0...-1]
end
+ def delete_last!
+ replace(delete_last)
+ end
+
unless defined?(Rails)
def from(position)
self[position, size] || []
end
end
@@ -81,9 +89,13 @@
end
end
def strip
reject { |v| v.blank? }
+ end
+
+ def strip!
+ replace(strip)
end
unless defined?(Rails)
def to(position)
position >= 0 ? first(position + 1) : self[0..position]
\ No newline at end of file