module SocialProfile

Constants

VERSION

Public Class Methods

get(auth_hash, options = {}) click to toggle source
# 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_path() click to toggle source
# File lib/social_profile.rb, line 44
def self.root_path
  @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
end