Class: DutchTop40::Songs

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

Constant Summary collapse

@@songs =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, name, listed, last_weeks_rank) ⇒ Songs

Returns a new instance of Songs.



7
8
9
10
11
12
13
# File 'lib/dutch_top40/songs.rb', line 7

def initialize(title, name, listed, last_weeks_rank)
    @title = title
    @name = name
    @listed = listed
    @last_weeks_rank = last_weeks_rank
    @@songs << self
end

Instance Attribute Details

#last_weeks_rankObject

Returns the value of attribute last_weeks_rank.



3
4
5
# File 'lib/dutch_top40/songs.rb', line 3

def last_weeks_rank
  @last_weeks_rank
end

#listedObject

Returns the value of attribute listed.



3
4
5
# File 'lib/dutch_top40/songs.rb', line 3

def listed
  @listed
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/dutch_top40/songs.rb', line 3

def name
  @name
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/dutch_top40/songs.rb', line 3

def title
  @title
end

Class Method Details

.listObject



16
17
18
19
# File 'lib/dutch_top40/songs.rb', line 16

def self.list
    DutchTop40::Scraper.scrape_songs
    @@songs
end