Sha256: 111ac694f888b76801352278cb835289be2a3a84aa7bea882725674675d79b8a
Contents?: true
Size: 497 Bytes
Versions: 1
Compression:
Stored size: 497 Bytes
Contents
# 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 'to be continued' unless is_last } ``` ```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.0 | README.md |