Sha256: f8c15fc19478f7ab2c245da2f97b10d38ce6e329e834812f3dcb93a1a2888ca3

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

require 'klout'
require 'json'

module Klout
  # Represents an identity
  class Identity
    class << self
      def find_by_twitter_id(twitter_id)
        response = Klout.get "/identity.json/tw/#{twitter_id}", :query => {key: Klout.api_key}
        Hashie::Mash.new(response)
      end
      
      def find_by_screen_name(screen_name)
        response = Klout.get "/identity.json/twitter", :query => {key: Klout.api_key, screenName: screen_name}
        Hashie::Mash.new(response)
      end
      
      def find_by_klout_id(klout_id)
        response = Klout.get "/identity.json/klout/#{klout_id}/tw", :query => {key: Klout.api_key}
        Hashie::Mash.new(response)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
klout-3.0.1 lib/klout/identity.rb
klout-3.0.0 lib/klout/identity.rb