Sha256: 56fd8d619b651a7825e52d26808a9da5b1c1ce06d4643c8606ad0219f02041cc

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

Stored size: 399 Bytes

Contents

class BillboardHot100::Song

  attr_accessor :rank, :title, :artist, :last_week, :peak_position, :weeks_on_chart, :lyrics, :award

  @@all = []

  def self.create(songs)
    songs.each do |song|
      self.new(song)
    end
  end

  def initialize(song_hash)
    song_hash.each do |key, value| 
      self.send(:"#{key}=", value)
    end
    @@all << self
  end

  def self.all
    @@all
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
billboard_hot_100_CLI-0.2.0 lib/billboard_hot_100/song.rb