Class: Skore::SkoreUtil
- Inherits:
-
Object
- Object
- Skore::SkoreUtil
- Defined in:
- lib/skore/skore_util.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SkoreUtil
constructor
A new instance of SkoreUtil.
- #score(social_network, username) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ SkoreUtil
Returns a new instance of SkoreUtil.
4 5 6 7 8 9 |
# File 'lib/skore/skore_util.rb', line 4 def initialize( = {}) @klout_api_key = [:klout_api_key] @peerindex_api_key = [:peerindex_api_key] @kred_app_id = [:kred_app_id] @kred_app_key = [:kred_app_key] end |
Instance Method Details
#score(social_network, username) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/skore/skore_util.rb', line 11 def score(, username) result = {} case .to_sym when :twitter then result[:klout] = Skore::KloutSkore.new(@klout_api_key).score(username, true) result[:peerindex] = Skore::PeerIndex.new(@peerindex_api_key).score(username) result[:kred] = Skore::Kred.new(@kred_app_id, @kred_app_key).score(.to_sym, username) else result[:klout] = Skore::KloutSkore.new(@klout_api_key).score(username, true) end result end |