Sha256: f767a507983b684222e93c8e8428af002a6fc8450e8eb63ef52539deef705222

Contents?: true

Size: 317 Bytes

Versions: 1

Compression:

Stored size: 317 Bytes

Contents

module Ect

  VERSION = '1.1.0'
end


class Object

  alias inflect tap

  def deflect

    yield(self)
  end
end


module Enumerable

  alias bisect partition

  def dissect

    inject([]) { |a, elt| (a[yield(elt)] ||= []) << elt; a }
  end

  def elect

    find { |elt| r = yield(elt); break r if r }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ect-1.1.0 lib/ect.rb