Sha256: 0e1f2056c79fba6ecf20319fe3088f0ecc7e1ce41cce654c129b25d98f1f1090

Contents?: true

Size: 240 Bytes

Versions: 29

Compression:

Stored size: 240 Bytes

Contents

# 1.9 has Enumerable#each_with_object, but 1.8 does not.
# This provides 1.8 compat for the places where we use each_with_object.
module Enumerable
  def each_with_object(object)
    each { |item| yield item, object }
    object
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
interpol-0.11.0 lib/interpol/each_with_object.rb
interpol-0.10.7 lib/interpol/each_with_object.rb
interpol-0.10.6 lib/interpol/each_with_object.rb
interpol-0.10.5 lib/interpol/each_with_object.rb
interpol-0.10.4 lib/interpol/each_with_object.rb
interpol-0.10.3 lib/interpol/each_with_object.rb
interpol-0.10.2 lib/interpol/each_with_object.rb
interpol-0.10.1 lib/interpol/each_with_object.rb
interpol-0.10.0 lib/interpol/each_with_object.rb
interpol-0.9.0 lib/interpol/each_with_object.rb
interpol-0.8.1 lib/interpol/each_with_object.rb
interpol-0.8.0 lib/interpol/each_with_object.rb
interpol-0.7.3 lib/interpol/each_with_object.rb
interpol-0.7.2 lib/interpol/each_with_object.rb
interpol-0.7.1 lib/interpol/each_with_object.rb
interpol-0.7.0 lib/interpol/each_with_object.rb
interpol-0.6.0 lib/interpol/each_with_object.rb
interpol-0.5.0 lib/interpol/each_with_object.rb
interpol-0.4.3 lib/interpol/each_with_object.rb
interpol-0.4.2 lib/interpol/each_with_object.rb