Class: VkMusic::WebParser::MyPage
- Defined in:
- lib/vk_music/web_parser/my_page.rb
Overview
Current user page parser
Instance Method Summary collapse
-
#id ⇒ Object
User id.
-
#name ⇒ Object
User name.
Methods inherited from Base
Constructor Details
This class inherits a constructor from VkMusic::WebParser::Base
Instance Method Details
#id ⇒ Object
User id
8 9 10 |
# File 'lib/vk_music/web_parser/my_page.rb', line 8 def id Integer(node.content.match(/window.vk = {"id":(\d+)/).captures.first, 10) end |
#name ⇒ Object
User name
13 14 15 16 |
# File 'lib/vk_music/web_parser/my_page.rb', line 13 def name link = node.at_css('.ip_user_link .op_owner') link.attribute('data-name').value end |