Sha256: e3562c40f80a0a31b35b92984d77da11b230d2e6b1542144d6c8bd3668ad64f2

Contents?: true

Size: 356 Bytes

Versions: 13

Compression:

Stored size: 356 Bytes

Contents

# encoding: utf-8
require 'attr_enumerable/attr_enumerable_helper'

# AttrEnumerable
module AttrEnumerable
  private
    def compact_attr(attribute, method_name, *args, &block)
      return [] if collection.empty?
      super(method_name, *args) unless include_attr?(collection.first, attribute)
      collection.map(&attribute.to_sym).compact
    end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.151 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.150 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.149 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.148 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.147 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.146 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.145 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.144 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.143 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.142 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.141 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.140 lib/attr_enumerable/compact_attr.rb
tbpgr_utils-0.0.139 lib/attr_enumerable/compact_attr.rb