Class: VkMusic::WebParser::Playlist
- Inherits:
-
Base
- Object
- Base
- VkMusic::WebParser::Playlist
show all
- Defined in:
- lib/vk_music/web_parser/playlist.rb
Overview
Playlist mobile web page parser
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#real_size ⇒ Integer?
26
27
28
29
30
|
# File 'lib/vk_music/web_parser/playlist.rb', line 26
def real_size
content = node.at_css('.audioPlaylist__footer').content
matches = content.gsub(/\s/, '').match(/^(\d+)/)&.captures
matches ? Integer(matches.first, 10) : nil
end
|
#subtitle ⇒ String?
18
19
20
21
22
23
|
# File 'lib/vk_music/web_parser/playlist.rb', line 18
def subtitle
result = node.at_css('.audioPlaylist__subtitle').content.strip
return if result.nil? || result.empty?
result
end
|
#title ⇒ String
13
14
15
|
# File 'lib/vk_music/web_parser/playlist.rb', line 13
def title
node.at_css('.audioPlaylist__title').content.strip
end
|