Sha256: 93f9e083d4a5c638c406fa79444d341ec724663e8c9211e5921ad5296606bd82
Contents?: true
Size: 500 Bytes
Versions: 47
Compression:
Stored size: 500 Bytes
Contents
unless ((1..2).inject(:+) rescue false) require 'backports/tools/alias_method' require 'backports/tools/alias_method_chain' module Enumerable def inject_with_symbol(*args, &block) return inject_without_symbol(*args, &block) if block_given? && args.size <= 1 method = args.pop inject_without_symbol(*args) {|memo, obj| memo.send(method, obj)} end Backports.alias_method_chain self, :inject, :symbol end Backports.alias_method Enumerable, :reduce, :inject end
Version data entries
47 entries across 47 versions & 4 rubygems