lib/with_last.rb in with_last-0.1.1 vs lib/with_last.rb in with_last-0.2.0

- old
+ new

@@ -1,14 +1,8 @@ -require "with_last/version" +# frozen_string_literal: true -module WithLast - class Error < StandardError; end - class ::Array - def each_with_last - each_with_index { |item, index| yield(item, last?(index)) } - end +require 'with_last/version' +require 'with_last/core_ext' - def last?(index) - size == (index + 1) - end - end +# with_last namespace +module WithLast end