Class: Rubyoverflow::Statistics
- Defined in:
- lib/rubyoverflow/statistics.rb
Instance Attribute Summary collapse
-
#answers_per_minute ⇒ Object
readonly
Returns the value of attribute answers_per_minute.
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#badges_per_minute ⇒ Object
readonly
Returns the value of attribute badges_per_minute.
-
#questions_per_minute ⇒ Object
readonly
Returns the value of attribute questions_per_minute.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
-
#total_accepted ⇒ Object
readonly
Returns the value of attribute total_accepted.
-
#total_answers ⇒ Object
readonly
Returns the value of attribute total_answers.
-
#total_badges ⇒ Object
readonly
Returns the value of attribute total_badges.
-
#total_comments ⇒ Object
readonly
Returns the value of attribute total_comments.
-
#total_questions ⇒ Object
readonly
Returns the value of attribute total_questions.
-
#total_unanswered ⇒ Object
readonly
Returns the value of attribute total_unanswered.
-
#total_users ⇒ Object
readonly
Returns the value of attribute total_users.
-
#total_votes ⇒ Object
readonly
Returns the value of attribute total_votes.
-
#views_per_day ⇒ Object
readonly
Returns the value of attribute views_per_day.
Class Method Summary collapse
-
.retrieve ⇒ Object
Retrieves the stats for the domain.
Instance Method Summary collapse
-
#initialize(hash, request_path = '') ⇒ Statistics
constructor
A new instance of Statistics.
Methods inherited from Base
change_end_point, client, convert_if_array, convert_to_id_list, #find_parse_querystring, request, #request
Constructor Details
#initialize(hash, request_path = '') ⇒ Statistics
Returns a new instance of Statistics.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubyoverflow/statistics.rb', line 7 def initialize(hash, request_path = '') dash = StatisticsDash.new hash @total_questions = dash.total_questions @total_accepted = dash.total_accepted @total_badges = dash.total_badges @total_unanswered = dash.total_unanswered @total_votes = dash.total_votes @total_comments = dash.total_comments @total_answers = dash.total_answers @total_users = dash.total_users @questions_per_minute = dash.questions_per_minute @answers_per_minute = dash.answers_per_minute @badges_per_minute = dash.badges_per_minute @views_per_day = dash.views_per_day @site = ApiSite.new dash.site @api_version = ApiVersion.new dash.api_version end |
Instance Attribute Details
#answers_per_minute ⇒ Object (readonly)
Returns the value of attribute answers_per_minute.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def answers_per_minute @answers_per_minute end |
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def api_version @api_version end |
#badges_per_minute ⇒ Object (readonly)
Returns the value of attribute badges_per_minute.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def badges_per_minute @badges_per_minute end |
#questions_per_minute ⇒ Object (readonly)
Returns the value of attribute questions_per_minute.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def questions_per_minute @questions_per_minute end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def site @site end |
#total_accepted ⇒ Object (readonly)
Returns the value of attribute total_accepted.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_accepted @total_accepted end |
#total_answers ⇒ Object (readonly)
Returns the value of attribute total_answers.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_answers @total_answers end |
#total_badges ⇒ Object (readonly)
Returns the value of attribute total_badges.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_badges @total_badges end |
#total_comments ⇒ Object (readonly)
Returns the value of attribute total_comments.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_comments @total_comments end |
#total_questions ⇒ Object (readonly)
Returns the value of attribute total_questions.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_questions @total_questions end |
#total_unanswered ⇒ Object (readonly)
Returns the value of attribute total_unanswered.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_unanswered @total_unanswered end |
#total_users ⇒ Object (readonly)
Returns the value of attribute total_users.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_users @total_users end |
#total_votes ⇒ Object (readonly)
Returns the value of attribute total_votes.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def total_votes @total_votes end |
#views_per_day ⇒ Object (readonly)
Returns the value of attribute views_per_day.
4 5 6 |
# File 'lib/rubyoverflow/statistics.rb', line 4 def views_per_day @views_per_day end |
Class Method Details
.retrieve ⇒ Object
Retrieves the stats for the domain
Maps to ‘stats’
32 33 34 35 |
# File 'lib/rubyoverflow/statistics.rb', line 32 def retrieve hash, url = request('stats') Statistics.new hash['statistics'].first, url end |