Sha256: 6f1375508aeb51fbea341672c7c4be2ad3f367eaa6999c8c81b7fe65e7ae8b57

Contents?: true

Size: 357 Bytes

Versions: 42

Compression:

Stored size: 357 Bytes

Contents

module RSpec
  module Core
    # @private
    module FlatMap
      if [].respond_to?(:flat_map)
        def flat_map(array)
          array.flat_map { |item| yield item }
        end
      else # for 1.8.7
        def flat_map(array)
          array.map { |item| yield item }.flatten
        end
      end

      module_function :flat_map
    end
  end
end

Version data entries

42 entries across 39 versions & 9 rubygems

Version Path
opal-rspec-0.8.0 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.8.0.alpha3 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.8.0.alpha2 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.8.0.alpha1 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.7.1 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.7.0 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.6.2 rspec-core/lib/rspec/core/flat_map.rb
opal-rspec-0.7.0.rc.2 rspec-core/upstream/lib/rspec/core/flat_map.rb
opal-rspec-0.6.1 rspec-core/lib/rspec/core/flat_map.rb
opal-rspec-0.6.0 rspec-core/lib/rspec/core/flat_map.rb
opal-rspec-0.6.0.beta1 rspec-core/lib/rspec/core/flat_map.rb
opal-connect-rspec-0.5.0 rspec-core/lib/rspec/core/flat_map.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/rspec-core-3.1.7/lib/rspec/core/flat_map.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/rspec-core-3.1.1/lib/rspec/core/flat_map.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/rspec-core-3.1.1/lib/rspec/core/flat_map.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/rspec-core-3.1.1/lib/rspec/core/flat_map.rb
opal-rspec-0.5.0 rspec-core/lib/rspec/core/flat_map.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/rspec-core-3.1.7/lib/rspec/core/flat_map.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/rspec-core-3.1.7/lib/rspec/core/flat_map.rb
logstash-codec-json-2.0.3 vendor/gems/rspec-core-3.1.7/lib/rspec/core/flat_map.rb