Class: Engagement::CommentCounter
- Inherits:
-
Object
- Object
- Engagement::CommentCounter
- Defined in:
- lib/engagement/comment_counter.rb,
lib/engagement/comment_counter/disqus.rb
Defined Under Namespace
Classes: Disqus, HackerNews, Reddit, Threaded
Instance Method Summary collapse
- #comments_count(url) ⇒ Object
-
#initialize(places) ⇒ CommentCounter
constructor
A new instance of CommentCounter.
Constructor Details
#initialize(places) ⇒ CommentCounter
9 10 11 |
# File 'lib/engagement/comment_counter.rb', line 9 def initialize(places) @places = places end |
Instance Method Details
#comments_count(url) ⇒ Object
13 14 15 16 17 |
# File 'lib/engagement/comment_counter.rb', line 13 def comments_count(url) @places.inject(0) do |comments_count, place| comments_count + place.comments_count(url) end end |