Module: SocialProfile

Defined in:
lib/social_profile.rb,
lib/social_profile/utils.rb,
lib/social_profile/person.rb,
lib/social_profile/version.rb,
lib/social_profile/response.rb,
lib/social_profile/people/google.rb,
lib/social_profile/people/twitter.rb,
lib/social_profile/providers/base.rb,
lib/social_profile/people/facebook.rb,
lib/social_profile/people/instagram.rb,
lib/social_profile/people/vkontakte.rb,
lib/social_profile/providers/google.rb,
lib/social_profile/providers/twitter.rb,
lib/social_profile/providers/facebook.rb,
lib/social_profile/providers/instagram.rb,
lib/social_profile/providers/vkontakte.rb,
lib/social_profile/ruby-instagram-scraper.rb,
lib/social_profile/people/instagram_parser.rb,
lib/social_profile/providers/odnoklassniki.rb

Defined Under Namespace

Modules: People, Providers, RubyInstagramScraper Classes: Person, Response, Utils

Constant Summary collapse

VERSION =
"0.3.2"

Class Method Summary collapse

Class Method Details

.get(auth_hash, options = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/social_profile.rb', line 28

def self.get(auth_hash, options = {})
  provider = auth_hash["provider"].to_s.downcase if auth_hash && auth_hash["provider"]

  klass = case provider
    when "facebook" then Providers::Facebook
    when "vkontakte" then Providers::Vkontakte
    when "twitter" then Providers::Twitter
    when "instagram" then Providers::Instagram
    when "odnoklassniki" then Providers::Odnoklassniki
    when "google" then Providers::Google
    else Providers::Base
  end

  klass.new(auth_hash, options)
end

.root_pathObject



44
45
46
# File 'lib/social_profile.rb', line 44

def self.root_path
  @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
end