Sha256: 7a2e37d17b0385df627f507091f766c9a7a8cbbc6cc16fa35f13b92c9e4b1bea
Contents?: true
Size: 554 Bytes
Versions: 15
Compression:
Stored size: 554 Bytes
Contents
module Percheron module CoreExtensions module Array module Extras def return result = nil each do |x| r = yield(x) if r result = r break end end result end def to_hash_by_key(key_attr) each_with_object({}) do |e, all| all[e.send(key_attr)] = e unless all[e.send(key_attr)] end end end end end end Array.send(:include, Percheron::CoreExtensions::Array::Extras)
Version data entries
15 entries across 15 versions & 1 rubygems