Sha256: 1426d41f1bd85b33eeb81b1ada9e63a197f1c2043af8469a2522931faab9c842

Contents?: true

Size: 263 Bytes

Versions: 41

Compression:

Stored size: 263 Bytes

Contents

# An Enumerable wrapper that will only yield non-empty elements
class Tracksperanto::YieldNonEmpty
  
  include Enumerable
  
  def initialize(obj)
    @obj = obj
  end
  
  def each
    @obj.each do | item |
      yield(item) unless item.empty?
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
tracksperanto-2.9.6 lib/tracksperanto/yield_non_empty.rb