Drop entries in storage, if more than new length
This commit is contained in:
parent
26d09a71fd
commit
01c1f97750
|
@ -22,7 +22,14 @@ module Rubella
|
||||||
def length= length
|
def length= length
|
||||||
@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
|
end
|
||||||
|
|
||||||
# Adds the data from the given storage to the own data and return this as a
|
# Adds the data from the given storage to the own data and return this as a
|
||||||
|
|
Loading…
Reference in New Issue