Class: VkMusic::WebParser::MyPage

Inherits:
Base
  • Object
show all
Defined in:
lib/vk_music/web_parser/my_page.rb

Overview

Current user page parser

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from VkMusic::WebParser::Base

Instance Method Details

#idObject

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

#nameObject

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