Class: Notu::LovedTracks
- Inherits:
-
Object
show all
- Includes:
- Enumerable, Listing
- Defined in:
- lib/notu/loved_tracks.rb
Instance Attribute Summary
Attributes included from Listing
#library
Instance Method Summary
collapse
Methods included from Listing
#initialize, #page_urls, #pages_count, #params
Instance Method Details
#each(&block) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/notu/loved_tracks.rb', line 8
def each(&block)
return unless block_given?
page_urls.each do |url|
document = HtmlDocument.get(url)
(document/'#user-loved-tracks-section tbody tr').each do |element|
artist = (element/'td.chartlist-name .chartlist-artists').first.text
title = (element/'td.chartlist-name .link-block-target').first.text
yield(Track.new(artist: artist, title: title))
end
end
nil
end
|
#path ⇒ Object
21
22
23
|
# File 'lib/notu/loved_tracks.rb', line 21
def path
'loved'
end
|