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:
parent
7c0c983dc2
commit
d26858c103
@ -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`.
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user