Sha256: 51d47529cf47bd7bcdba348df610e91a5d4dad3d5b73bec9c2adec6bc6dbb8a7

Contents?: true

Size: 348 Bytes

Versions: 6

Compression:

Stored size: 348 Bytes

Contents

module RSpec
  module Core
    # @private
    module FlatMap
      if [].respond_to?(:flat_map)
        def flat_map(array, &block)
          array.flat_map(&block)
        end
      else # for 1.8.7
        def flat_map(array, &block)
          array.map(&block).flatten(1)
        end
      end

      module_function :flat_map
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
suzuko-0.1.8 vendor/bundle/ruby/2.0.0/gems/rspec-core-3.2.3/lib/rspec/core/flat_map.rb
suzuko-0.1.7 vendor/bundle/ruby/2.0.0/gems/rspec-core-3.2.3/lib/rspec/core/flat_map.rb
rspec-core-3.2.3 lib/rspec/core/flat_map.rb
rspec-core-3.2.2 lib/rspec/core/flat_map.rb
rspec-core-3.2.1 lib/rspec/core/flat_map.rb
rspec-core-3.2.0 lib/rspec/core/flat_map.rb