File: variable_args_block_caller.rb

package info (click to toggle)
ruby-vcr 6.0.0%2Breally5.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,320 kB
  • sloc: ruby: 8,456; sh: 177; makefile: 7
file content (13 lines) | stat: -rw-r--r-- 226 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
module VCR
  # @private
  module VariableArgsBlockCaller
    def call_block(block, *args)
      if block.arity >= 0
        args = args.first([args.size, block.arity].min)
      end

      block.call(*args)
    end
  end
end