Sha256: 9e2deafea6b93de8961f1a7031ca02d480ea8564355ad0b0befb391f4a800085

Contents?: true

Size: 197 Bytes

Versions: 396

Compression:

Stored size: 197 Bytes

Contents

class Array
  def keep
    kept = []
    each { |e| kept << e if yield(e) }
    kept
  end

  def discard
    discarded = []
    each { |e| discarded << e unless yield(e) }
    discarded
  end
end

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.179 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.178 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.177 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.176 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.175 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.174 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.173 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.172 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.171 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.170 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.169 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.167 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.166 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.165 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.164 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.163 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.162 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.161 tracks/ruby/exercises/strain/.meta/solutions/strain.rb
trackler-2.2.1.160 tracks/ruby/exercises/strain/.meta/solutions/strain.rb