Sha256: 642d6c089a4d2acf9064cdd8fe837e6a086b8e53e35921e431ab8b11ebb49f45

Contents?: true

Size: 231 Bytes

Versions: 1

Compression:

Stored size: 231 Bytes

Contents

module Casting
  module Enum
    def enum(collection, *behaviors)
      enum = Enumerator.new do |yielder|
        collection.each do |item|
          yielder.yield(item.cast_as(*behaviors))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
casting-1.0.1 lib/casting/enum.rb