diff --git a/lib/rubella/storage.rb b/lib/rubella/storage.rb index 6c79d7f..6aa166b 100644 --- a/lib/rubella/storage.rb +++ b/lib/rubella/storage.rb @@ -22,7 +22,14 @@ module Rubella def length= length @length = length - # TODO drop entries, if more than new length + # Drop entries, if more than new length + if @length.kind_of? Integer + while @data.length > @length + @data.pop + end + end + + @length end # Adds the data from the given storage to the own data and return this as a