lib/pilha/stack_overflow/statistics.rb in pilha-0.1.5 vs lib/pilha/stack_overflow/statistics.rb in pilha-0.1.6
- old
+ new
@@ -1,10 +1,9 @@
module StackExchange
module StackOverflow
+ class Statistics < Base
- class Statistics
-
extend Forwardable
def_delegators :@struct, :total_questions, :total_unanswered, :total_answers,
:total_comments, :total_votes, :total_badges,
:total_users, :questions_per_minute, :answers_per_minute,
@@ -16,14 +15,16 @@
class << self
attr_reader :client
def all(options = {})
- response = client.request('/stats', options)
- stats = response['statistics'].first
- Statistics.new stats
+ request('/stats', nil, options)
end
- end
+ private
+ def parse(response)
+ Statistics.new response['statistics'].first
+ end
+ end
end
end
end