Sha256: 69f91c5b9352d8245765bf89d1523163c66af5bedbee7820b33af4e46aab3b68
Contents?: true
Size: 469 Bytes
Versions: 9
Compression:
Stored size: 469 Bytes
Contents
# encoding: utf-8 require 'attr_enumerable/attr_enumerable_helper' # AttrEnumerable module AttrEnumerable private def include_attribute?(attribute, method_name, *args, &block) col = collection return false if col.empty? include_value = args.first fail ArgumentError, "invalid attribute #{attribute}" unless include_attr?(col.first, attribute) attrs = col.map { |v|v.send(attribute) } attrs.include?(include_value) end end
Version data entries
9 entries across 9 versions & 1 rubygems