lib/social_profile.rb in social_profile-0.1.4 vs lib/social_profile.rb in social_profile-0.2.0
- old
+ new
@@ -1,6 +1,5 @@
-# encoding: utf-8
require "social_profile/version"
module SocialProfile
autoload :Utils, "social_profile/utils"
autoload :Response, "social_profile/response"
@@ -8,24 +7,33 @@
module Providers
autoload :Base, "social_profile/providers/base"
autoload :Facebook, "social_profile/providers/facebook"
autoload :Vkontakte, "social_profile/providers/vkontakte"
+ autoload :Twitter, "social_profile/providers/twitter"
+ autoload :Instagram, "social_profile/providers/instagram"
end
module People
autoload :Facebook, "social_profile/people/facebook"
autoload :Vkontakte, "social_profile/people/vkontakte"
+ autoload :Twitter, "social_profile/people/twitter"
end
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
else Providers::Base
end
klass.new(auth_hash, options)
+ end
+
+ def self.root_path
+ @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
end
end