Class: Track

Inherits:
Object
  • Object
show all
Defined in:
lib/track.rb

Constant Summary collapse

ATTRIBUTES =
[:track_id, :name, :artist, :album, :genre, :kind, :size, :total_time, :track_number, :track_count, :year, :date_modified, :date_added, :bit_rate, :sample_rate, :play_count, :play_date, :play_date_utc, :rating, :album_rating, :artwork_count, :persistent_id, :track_type, :location]

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Track

Returns a new instance of Track.



6
7
8
9
10
# File 'lib/track.rb', line 6

def initialize(hash)
  ATTRIBUTES.each do |attribute|
    self.send("#{attribute}=", (hash[attribute] || ""))
  end
end