Module: TheCount

Defined in:
lib/thecount/countable/google.rb,
lib/thecount.rb,
lib/thecount/countable.rb,
lib/thecount/countable/digg.rb,
lib/thecount/countable/disqus.rb,
lib/thecount/countable/twitter.rb,
lib/thecount/countable/facebook.rb,
lib/thecount/countable/linkedin.rb

Overview

Since Google is in between Buzz and +1, lets make no assumptions on a default and fully qualify both

Defined Under Namespace

Classes: Countable, Digg, Disqus, Facebook, Google, LinkedIn, Twitter

Class Method Summary collapse

Class Method Details

.count {|config| ... } ⇒ Object

Yields:

  • (config)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/thecount.rb', line 10

def self.count
  config = {}
  yield config

  strategies = config[:strategies]
  args = config[:args]

  strategies = [strategies] unless strategies.kind_of?(Array)
  results = {}
  strategies.each { |s|
    service = s.new
    service.count(args)
    results[s] = service
  }
  results
end