Sha256: ad9efa173d49b1dc212a5e278d550254f72a145854d29dc0a2fd4aaa9a52505f

Contents?: true

Size: 272 Bytes

Versions: 7

Compression:

Stored size: 272 Bytes

Contents

module Storefront
  module CollectionHelper
    def collection_class(index, length)
      length = length.length if length.is_a?(::Array)
      if index == 0
        "first"
      elsif index == length - 1
        "last"
      else
        nil
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
storefront-0.3.2 lib/storefront/helpers/collection_helper.rb
storefront-0.3.1 lib/storefront/helpers/collection_helper.rb
storefront-0.3.0 lib/storefront/helpers/collection_helper.rb
storefront-0.2.8 lib/storefront/helpers/collection_helper.rb
storefront-0.2.7 lib/storefront/helpers/collection_helper.rb
storefront-0.2.1 lib/storefront/helpers/collection_helper.rb
storefront-0.2.0 lib/storefront/helpers/collection_helper.rb