Sha256: 417390b1a4ed1a980d70e4aec85660c70604223b57dcaf0bdbd818bbe463edd3

Contents?: true

Size: 343 Bytes

Versions: 1

Compression:

Stored size: 343 Bytes

Contents

class IdsPlease::GooglePlus < IdsPlease::BaseParser

  MASK = /google/i

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

  def self.parse_link(link)
    if link.host == 'google.com'
      link.path.split('/')[1]
    else
      matched = link.path.match(/\/(\d{2,})\//)
      matched[1] if matched
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ids_please-0.0.1 lib/ids_please/google_plus.rb