Sha256: c4cf9f6fb2bc9bed48955e86a46b14b4ca9ff3214e92ec6ca462ec456e1baf8a
Contents?: true
Size: 595 Bytes
Versions: 1
Compression:
Stored size: 595 Bytes
Contents
[![Gem Version](https://badge.fury.io/rb/with_last.svg)](https://badge.fury.io/rb/with_last) # with_last.rb Add `each_with_last` to `Array`. ## Installation ```ruby gem 'with_last' ``` And then execute: $ bundle install ## Usage ```ruby [1,2,3,4,5,6].each_with_last { |item, is_last| puts item puts is_last ? 'done' : 'to be continued' } ``` ```erb <% some_list.each_with_last do |item, is_last| %> <%= item %><%= is_last ? '.' : ',' %> <% end %> ``` ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
with_last-0.1.1 | README.md |