Sha256: 08abf0c9c2b8e10d54f99ce6fbb30017cdc62c6e4908ad8f00614a6bf729f702

Contents?: true

Size: 252 Bytes

Versions: 9

Compression:

Stored size: 252 Bytes

Contents

module PM

class SortedSongList < SongList

  def <<(song)
    next_song_after = @songs.detect { |s| s.name > song.name }
    if next_song_after
      @songs.insert(@songs.index(next_song_after), song)
    else
      super(song)
    end
  end

end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
patchmaster-2.0.0 lib/patchmaster/sorted_song_list.rb
patchmaster-1.1.2 lib/patchmaster/sorted_song_list.rb
patchmaster-1.0.0 lib/patchmaster/sorted_song_list.rb
patchmaster-0.0.6 lib/patchmaster/sorted_song_list.rb
patchmaster-0.0.5 lib/patchmaster/sorted_song_list.rb
patchmaster-0.0.4 lib/patchmaster/sorted_song_list.rb
patchmaster-0.0.3 lib/patchmaster/sorted_song_list.rb
patchmaster-0.0.2 lib/patchmaster/sorted_song_list.rb
patchmaster-0.0.1 lib/patchmaster/sorted_song_list.rb