1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Add Rackstash::Fields::Array#size as an alias to length

This commit is contained in:
Holger Just 2017-06-22 23:00:51 +02:00
parent 7c0c983dc2
commit d26858c103
2 changed files with 7 additions and 0 deletions

View File

@ -126,6 +126,7 @@ module Rackstash
def length
@raw.length
end
alias size length
# Set Union -- Add value from `array` to `self` excluding any duplicates
# and preserving the order from `self`.

View File

@ -228,6 +228,12 @@ describe Rackstash::Fields::Array do
array.clear
expect(array.length).to eql 0
end
it 'can use size as an alias' do
expect(array.size).to eql 0
array[0] = 'first'
expect(array.size).to eql 1
end
end
describe '#merge' do