Sha256: c3363559a1a86802267d52eb6650864b747b294c5498860d0f71152c9312cb4a

Contents?: true

Size: 507 Bytes

Versions: 7

Compression:

Stored size: 507 Bytes

Contents

class IdsPlease
  module Parsers
    class Vkontakte < IdsPlease::Parsers::Base

      MASK = /vk\.com|vkontakte/i

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

        private

        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
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ids_please-2.2.0 lib/ids_please/parsers/vkontakte.rb
ids_please-2.1.2 lib/ids_please/parsers/vkontakte.rb
ids_please-2.1.1 lib/ids_please/parsers/vkontakte.rb
ids_please-2.1.0 lib/ids_please/parsers/vkontakte.rb
ids_please-2.0.0.beta2 lib/ids_please/parsers/vkontakte.rb
ids_please-2.0.0.beta1 lib/ids_please/parsers/vkontakte.rb
ids_please-2.0.0.beta lib/ids_please/parsers/vkontakte.rb