Sha256: 628604016723a0e5fe9836e67adb4be3c88444392b956a48e7fed8e29c77ac74

Contents?: true

Size: 661 Bytes

Versions: 2

Compression:

Stored size: 661 Bytes

Contents

require "twitter"

module SocialProfile
  module People
    class Twitter < Person

      # Get friends count
      def friends_count
        @friends_count ||= fetch_friends_count
      end

      def fetch_friends_count
        client.user.followers_count
      end
      
      protected
      
        def client
          @client ||= ::Twitter::REST::Client.new do |config|
            config.consumer_key        = options[:api_key]
            config.consumer_secret     = options[:api_secret]
            config.access_token        = access_token
            config.access_token_secret = options[:token_secret]
          end
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_profile-0.2.1 lib/social_profile/people/twitter.rb
social_profile-0.2.0 lib/social_profile/people/twitter.rb