Class: IdsPlease::Parsers::Vkontakte

Inherits:
Base
  • Object
show all
Defined in:
lib/ids_please/parsers/vkontakte.rb

Constant Summary collapse

MASK =
/vk\.com|vkontakte/i

Class Method Summary collapse

Methods inherited from Base

to_sym, valid_id_regex

Class Method Details

.interact(links) ⇒ Object



8
9
10
# File 'lib/ids_please/parsers/vkontakte.rb', line 8

def interact(links)
  links.map { |l| parse_link(l) }.compact
end


12
13
14
15
16
17
18
19
# File 'lib/ids_please/parsers/vkontakte.rb', line 12

def parse_link(link)
  if link.path =~ /id|club|public/
    id = link.path.sub(/\A\/id|\A\/club|\A\/public/, '')
    id.split(/[\/\?#]/).first
  else
    super
  end
end