Sha256: e2c5f611749a2c3d2abdf55362a3ca675f3b3d6d58a705abc8f077371d4583ca

Contents?: true

Size: 515 Bytes

Versions: 13

Compression:

Stored size: 515 Bytes

Contents

module DuckPuncher
  module Ducks
    module Enumerable
      def m(method_name)
        map(&method_name)
      end

      def m!(method_name)
        map!(&method_name)
      end

      def mm(method_name, *args)
        map { |x| x.public_send(method_name, *args) }
      end

      def mm!(method_name, *args)
        map! { |x| x.public_send(method_name, *args) }
      end

      def except(*args)
        self - args
      end

      def map_keys(key)
        map { |x| x[key] }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
duck_puncher-5.0.1 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-5.0.0 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.5.1 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.5.0 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.4.2 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.4.1 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.4.0 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.3.1 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.3.0 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.2.3 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.2.2 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.2.1 lib/duck_puncher/ducks/enumerable.rb
duck_puncher-4.2.0 lib/duck_puncher/ducks/enumerable.rb