Sha256: 8ff7578da04f78a20afd39d44d69cfa512161da0372ff55b2e74e86fefa1a45f
Contents?: true
Size: 453 Bytes
Versions: 4
Compression:
Stored size: 453 Bytes
Contents
# encoding: utf-8 require 'attr_enumerable/attr_enumerable_helper' # AttrEnumerable module AttrEnumerable private def select_attr(attribute, method_name, *args, &block) col = collection # count = args.size == 0 ? 1 : Integer(args.first) fail ArgumentError, "invalid attribute #{attribute}" unless include_attr?(col.first, attribute) attrs = col.map { |e|e.send(attribute) } attrs.select { |e| yield(e) } end end
Version data entries
4 entries across 4 versions & 1 rubygems