Sha256: 9f46df885ea5c08834b8ac36fb8c5bdd077af1015c3f20f67a79fc3db09149ff

Contents?: true

Size: 504 Bytes

Versions: 7

Compression:

Stored size: 504 Bytes

Contents

module Polyfill
  module V2_5
    module Enumerable
      def all?(*pattern)
        return super if pattern.empty?

        grep(*pattern).size == size
      end

      def any?(*pattern)
        return super if pattern.empty?

        !grep(*pattern).empty?
      end

      def none?(*pattern)
        return super if pattern.empty?

        grep(*pattern).empty?
      end

      def one?(*pattern)
        return super if pattern.empty?

        grep(*pattern).size == 1
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
polyfill-1.9.0 lib/polyfill/v2_5/enumerable.rb
polyfill-1.8.0 lib/polyfill/v2_5/enumerable.rb
polyfill-1.7.0 lib/polyfill/v2_5/enumerable.rb
polyfill-1.6.0 lib/polyfill/v2_5/enumerable.rb
polyfill-1.5.0 lib/polyfill/v2_5/enumerable.rb
polyfill-1.4.0 lib/polyfill/v2_5/enumerable.rb
polyfill-1.3.0 lib/polyfill/v2_5/enumerable.rb