Sha256: be49c901e81775dcbab16f1ae5b876c08525a14a708651b9ff8c1daf70f1c9ba

Contents?: true

Size: 493 Bytes

Versions: 12

Compression:

Stored size: 493 Bytes

Contents

module Gdshowsdb
  class SongDBExtractor
    def self.from_db(year)      
      SongDBExtractor.new(Song.find_all_by_year(year))
    end    

    def initialize(songs)
      @songs = songs
    end

    def extract
      @songs.map do |song|
        song_map = song.attributes.convert_to_sym
        song_map[:name] = song.song_ref.name if song.song_ref
        song_map.reject {|k,v| k == :song_ref_uuid }
      end.reject do |song_map|
        song_map[:name].nil?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gdshowsdb-4.0.2 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-4.0.1 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-4.0.0 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-3.0.0 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-2.1.0 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-2.0.0 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-1.0.3 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-1.0.2 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-1.0.1 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-1.0.0 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-0.9.1 lib/gdshowsdb/song_db_extractor.rb
gdshowsdb-0.9.0 lib/gdshowsdb/song_db_extractor.rb