class VkMusic::WebParser::MyPage

Current user page parser

Public Instance Methods

id() click to toggle source

User id

# 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() click to toggle source

User name

# 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