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-4.2.0 lib/tracksperanto/yield_non_empty.rb
tracksperanto-4.1.3 lib/tracksperanto/yield_non_empty.rb
tracksperanto-4.1.2 lib/tracksperanto/yield_non_empty.rb
tracksperanto-4.1.0 lib/tracksperanto/yield_non_empty.rb
tracksperanto-4.0.0 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.9 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.8 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.7 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.6 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.5 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.4 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.2 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.1 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.5.0 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.4.1 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.4.0 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.3.13 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.3.12 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.3.11 lib/tracksperanto/yield_non_empty.rb
tracksperanto-3.3.10 lib/tracksperanto/yield_non_empty.rb