Class: SocialParser::Provider::Github

Inherits:
Base
  • Object
show all
Defined in:
lib/social_parser/provider/github.rb

Constant Summary collapse

URL_FORMATS =
{
  full: /((https?)?:\/\/)?(www\.)?github\.com\/(?<id>[\w\-\.]+)?/i
  # regular: /\Ahttps?:\/\/github\.com\/(?<id>.+?)\/?\Z/
}

Instance Method Summary collapse

Methods inherited from Base

#domain, #embed_url, parse, #username, #valid?

Methods inherited from Link

#attributes, #embed_url, #id, #initialize, #username

Constructor Details

This class inherits a constructor from SocialParser::Link

Instance Method Details

#providerObject



11
12
13
# File 'lib/social_parser/provider/github.rb', line 11

def provider
  :github
end

#urlObject



15
16
17
# File 'lib/social_parser/provider/github.rb', line 15

def url
  "https://github.#{domain}/#{username}"
end