class Skore::KloutSkore

Attributes

user[RW]

Public Class Methods

new(api_key) click to toggle source

Initialize Base and almacenate user information

# File lib/skore/klout.rb, line 12
def initialize(api_key)
  raise ArgumentError, 'api_key is required' if api_key == nil || api_key.empty?
  Klout.api_key = api_key
end

Public Instance Methods

score(username, round=false) click to toggle source

Get score for user

# File lib/skore/klout.rb, line 18
def score(username, round=false)
  begin
    identity = Identity.find_by_screen_name(username)
    @user = User.new(identity.id)
    if round
      @user.score.score.round
    else
      @user.score.score
    end
  rescue
    nil
  end
end