Sha256: 2b2a1d9690f06d5d083a0e56c7b16ac4dd8305ba7369770dc2c250f39196ee26

Contents?: true

Size: 429 Bytes

Versions: 15

Compression:

Stored size: 429 Bytes

Contents

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

# AttrEnumerable
module AttrEnumerable
  private
    def each_attr_with_index(attribute, method_name, *args, &block)
      collection.each_with_index do |element, index|
        super(method_name, *args) unless include_attr?(element, attribute)
        yield element.send(attribute), index
      end
    end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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