1
0
mirror of https://github.com/meineerde/rackstash.git synced 2026-02-01 01:37:12 +00:00

Stop splatting clean hash argument in Bufferstack#push

The optional keyword arguments are already cleaned by the keyword splat
in BufferStack#push. They are automatically unsplatted when calling
Buffer#initialize anyway.
This commit is contained in:
Holger Just 2017-07-25 12:35:26 +02:00
parent f92bde5af2
commit c370aecbcd
2 changed files with 4 additions and 4 deletions

View File

@ -47,8 +47,8 @@ module Rackstash
# @param buffer_args [Hash<Symbol => Object>] optional arguments for the new
# {Buffer}. See {Buffer#initialize} for allowed values.
# @return [Buffer] the newly created buffer
def push(**buffer_args)
buffer = Buffer.new(sink, **buffer_args)
def push(buffer_args = {})
buffer = Buffer.new(sink, buffer_args)
@stack_mutex.synchronize do
@stack.push buffer
end

View File

@ -376,10 +376,10 @@ module Rackstash
# @param buffer_args [Hash<Symbol => Object>] optional arguments for the new
# {Buffer}. See {Buffer#initialize} for allowed values.
# @return [Object] the return value of the block
def with_buffer(**buffer_args)
def with_buffer(buffer_args = {})
raise ArgumentError, 'block required' unless block_given?
buffer_stack.push(**buffer_args)
buffer_stack.push(buffer_args)
begin
yield
ensure