Sha256: cf565a951a7f99758ed42da4f5f6c586d1846431177c2c09576cfc93703e9497

Contents?: true

Size: 510 Bytes

Versions: 6

Compression:

Stored size: 510 Bytes

Contents

class IdsPlease
  module Parsers
    class GooglePlus < IdsPlease::Parsers::Base

      MASK = /google/i

      class << self
        def to_sym
          :google_plus
        end

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

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

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ids_please-2.3.0 lib/ids_please/parsers/google_plus.rb
ids_please-2.2.5 lib/ids_please/parsers/google_plus.rb
ids_please-2.2.4 lib/ids_please/parsers/google_plus.rb
ids_please-2.2.3 lib/ids_please/parsers/google_plus.rb
ids_please-2.2.2 lib/ids_please/parsers/google_plus.rb
ids_please-2.2.1 lib/ids_please/parsers/google_plus.rb