Class: IdsPlease::Parsers::GooglePlus

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

Constant Summary collapse

MASK =
/google/i

Class Method Summary collapse

Methods inherited from Base

valid_id_regex

Class Method Details

.interact(links) ⇒ Object



12
13
14
# File 'lib/ids_please/parsers/google_plus.rb', line 12

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


16
17
18
19
20
21
22
# File 'lib/ids_please/parsers/google_plus.rb', line 16

def parse_link(link)
  if matched = link.path.match(/\/(\+\w+)/)
    matched[1]
  elsif matched = link.path.match(/\/(\d{2,})/)
    matched[1]
  end
end

.to_symObject



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

def to_sym
  :google_plus
end