Class: Stacked::User
Instance Attribute Summary collapse
-
#about_me ⇒ Object
Returns the value of attribute about_me.
-
#accept_rate ⇒ Object
Returns the value of attribute accept_rate.
-
#age ⇒ Object
Returns the value of attribute age.
-
#answer_count ⇒ Object
Returns the value of attribute answer_count.
-
#creation_date ⇒ Object
(also: #created_at)
Returns the value of attribute creation_date.
-
#display_name ⇒ Object
(also: #name)
Returns the value of attribute display_name.
-
#down_vote_count ⇒ Object
(also: #down_votes)
Returns the value of attribute down_vote_count.
-
#email_hash ⇒ Object
(also: #gravatar)
Returns the value of attribute email_hash.
-
#last_access_date ⇒ Object
Returns the value of attribute last_access_date.
-
#location ⇒ Object
Returns the value of attribute location.
-
#question_count ⇒ Object
Returns the value of attribute question_count.
-
#reputation ⇒ Object
Returns the value of attribute reputation.
-
#up_vote_count ⇒ Object
(also: #up_votes)
Returns the value of attribute up_vote_count.
-
#user_id ⇒ Object
(also: #id)
Returns the value of attribute user_id.
-
#user_type ⇒ Object
(also: #type)
Returns the value of attribute user_type.
-
#view_count ⇒ Object
(also: #views)
Returns the value of attribute view_count.
-
#website_url ⇒ Object
Returns the value of attribute website_url.
Class Method Summary collapse
-
.filter(filter, options = {}) ⇒ Object
Returns users matching the given filter.
Instance Method Summary collapse
-
#added_favorites(options = {}) ⇒ Object
(also: #added_favourites)
Paginated favorites in the order they were added.
-
#answers(options = {}) ⇒ Object
(also: #recent_answers)
Paginated answers for this user.
-
#answers_by_views(options = {}) ⇒ Object
Paginated answers by views for this user.
-
#answers_by_votes(options = {}) ⇒ Object
Paginated answers by votes for this user.
- #badges(options = {}) ⇒ Object
-
#comments(options = {}) ⇒ Object
Paginated comments for this user.
-
#comments_by_score(options = {}) ⇒ Object
(also: #popular_comments)
Paginated comments for this user ordered by score.
-
#directed_at(other_user_id, options = {}) ⇒ Object
Find a comment directed at
other_user_id
. -
#directed_at_by_date(other_user_id, options = {}) ⇒ Object
All comments directed at
other_user_id
ordered by creation date in descending order. -
#directed_at_by_score(other_user_id, options = {}) ⇒ Object
All comments directed at
other_user_id
ordered by votes. -
#favorites(options = {}) ⇒ Object
(also: #favourites, #recent_favourites)
Paginated favorites.
- #mentioned(options = {}) ⇒ Object (also: #mentions)
-
#newest_answers(options = {}) ⇒ Object
Newest answers for this user.
- #newest_favorites(options = {}) ⇒ Object (also: #newest_favourites)
-
#newest_questions(options = {}) ⇒ Object
Questions #.
- #popular_favorites(options = {}) ⇒ Object (also: #favorites_by_views, #favourites_by_views, #popular_favourites)
- #questions(options = {}) ⇒ Object
- #questions_by_views(options = {}) ⇒ Object
- #questions_by_votes(options = {}) ⇒ Object (also: #popular_questions)
-
#recent_comments(options = {}) ⇒ Object
Paginated comments for this user ordered by date created.
- #recent_favorites(options = {}) ⇒ Object
- #recent_questions(options = {}) ⇒ Object
-
#reputations(options = {}) ⇒ Object
Other stuff #.
- #tags(options = {}) ⇒ Object
- #timeline(options = {}) ⇒ Object
Methods inherited from Base
all, association, collection, find, #initialize, #parse_answers, #parse_badges, #parse_comments, #parse_post_timeline, #parse_questions, #parse_reputations, #parse_tags, #parse_type, #parse_user_timeline, #post, records, request, singular, stats
Constructor Details
This class inherits a constructor from Stacked::Base
Instance Attribute Details
#about_me ⇒ Object
Returns the value of attribute about_me.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def about_me @about_me end |
#accept_rate ⇒ Object
Returns the value of attribute accept_rate.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def accept_rate @accept_rate end |
#age ⇒ Object
Returns the value of attribute age.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def age @age end |
#answer_count ⇒ Object
Returns the value of attribute answer_count.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def answer_count @answer_count end |
#creation_date ⇒ Object Also known as: created_at
Returns the value of attribute creation_date.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def creation_date @creation_date end |
#display_name ⇒ Object Also known as: name
Returns the value of attribute display_name.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def display_name @display_name end |
#down_vote_count ⇒ Object Also known as: down_votes
Returns the value of attribute down_vote_count.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def down_vote_count @down_vote_count end |
#email_hash ⇒ Object Also known as: gravatar
Returns the value of attribute email_hash.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def email_hash @email_hash end |
#last_access_date ⇒ Object
Returns the value of attribute last_access_date.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def last_access_date @last_access_date end |
#location ⇒ Object
Returns the value of attribute location.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def location @location end |
#question_count ⇒ Object
Returns the value of attribute question_count.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def question_count @question_count end |
#reputation ⇒ Object
Returns the value of attribute reputation.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def reputation @reputation end |
#up_vote_count ⇒ Object Also known as: up_votes
Returns the value of attribute up_vote_count.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def up_vote_count @up_vote_count end |
#user_id ⇒ Object Also known as: id
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def user_id @user_id end |
#user_type ⇒ Object Also known as: type
Returns the value of attribute user_type.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def user_type @user_type end |
#view_count ⇒ Object Also known as: views
Returns the value of attribute view_count.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def view_count @view_count end |
#website_url ⇒ Object
Returns the value of attribute website_url.
3 4 5 |
# File 'lib/stacked/user.rb', line 3 def website_url @website_url end |
Class Method Details
.filter(filter, options = {}) ⇒ Object
Returns users matching the given filter.
27 28 29 30 |
# File 'lib/stacked/user.rb', line 27 def filter(filter, ={}) .reverse_merge!(:filter => filter) records(path, ) end |
Instance Method Details
#added_favorites(options = {}) ⇒ Object Also known as: added_favourites
Paginated favorites in the order they were added.
100 101 102 |
# File 'lib/stacked/user.rb', line 100 def added_favorites(={}) parse_questions(request(singular(id) + "favorites/added", )) end |
#answers(options = {}) ⇒ Object Also known as: recent_answers
Paginated answers for this user.
38 39 40 |
# File 'lib/stacked/user.rb', line 38 def answers(={}) parse_answers(request(singular(id) + "answers", )) end |
#answers_by_views(options = {}) ⇒ Object
Paginated answers by views for this user.
43 44 45 |
# File 'lib/stacked/user.rb', line 43 def answers_by_views(={}) parse_answers(request(singular(id) + "answers/views", )) end |
#answers_by_votes(options = {}) ⇒ Object
Paginated answers by votes for this user.
48 49 50 |
# File 'lib/stacked/user.rb', line 48 def answers_by_votes(={}) parse_answers(request(singular(id) + "answers/votes", )) end |
#badges(options = {}) ⇒ Object
169 170 171 |
# File 'lib/stacked/user.rb', line 169 def badges(={}) parse_badges(request(singular(id) + "badges", )) end |
#comments(options = {}) ⇒ Object
Paginated comments for this user.
62 63 64 |
# File 'lib/stacked/user.rb', line 62 def comments(={}) parse_comments(request(singular(id) + "comments", )) end |
#comments_by_score(options = {}) ⇒ Object Also known as: popular_comments
Paginated comments for this user ordered by score.
84 85 86 |
# File 'lib/stacked/user.rb', line 84 def comments_by_score(={}) parse_comments(request(singular(id) + "comments/score", )) end |
#directed_at(other_user_id, options = {}) ⇒ Object
Find a comment directed at other_user_id
. Works only if you specify it the correct range. This method’s a bit funny. dev.meta.stackoverflow.com/questions/34747/comments-api-method
69 70 71 |
# File 'lib/stacked/user.rb', line 69 def directed_at(other_user_id, ={}) parse_comments(request(singular(id) + "comments" + other_user_id.to_s, )) end |
#directed_at_by_date(other_user_id, options = {}) ⇒ Object
All comments directed at other_user_id
ordered by creation date in descending order.
74 75 76 |
# File 'lib/stacked/user.rb', line 74 def directed_at_by_date(other_user_id, ={}) parse_comments(request(singular(id) + "comments" + other_user_id.to_s + "recent", )) end |
#directed_at_by_score(other_user_id, options = {}) ⇒ Object
All comments directed at other_user_id
ordered by votes.
79 80 81 |
# File 'lib/stacked/user.rb', line 79 def directed_at_by_score(other_user_id, ={}) parse_comments(request(singular(id) + "comments" + other_user_id.to_s + "score", )) end |
#favorites(options = {}) ⇒ Object Also known as: favourites, recent_favourites
Paginated favorites.
105 106 107 |
# File 'lib/stacked/user.rb', line 105 def favorites(={}) parse_questions(request(singular(id) + "favorites", )) end |
#mentioned(options = {}) ⇒ Object Also known as: mentions
165 166 167 |
# File 'lib/stacked/user.rb', line 165 def mentioned(={}) parse_comments(request(singular(id) + "mentioned", )) end |
#newest_answers(options = {}) ⇒ Object
Newest answers for this user.
53 54 55 |
# File 'lib/stacked/user.rb', line 53 def newest_answers(={}) parse_answers(request(singular(id) + "answers/newest", )) end |
#newest_favorites(options = {}) ⇒ Object Also known as: newest_favourites
109 110 111 |
# File 'lib/stacked/user.rb', line 109 def newest_favorites(={}) parse_questions(request(singular(id) + "favorites/newest", )) end |
#newest_questions(options = {}) ⇒ Object
Questions #
135 136 137 |
# File 'lib/stacked/user.rb', line 135 def newest_questions(={}) parse_questions(request(singular(id) + "questions/newest", )) end |
#popular_favorites(options = {}) ⇒ Object Also known as: favorites_by_views, favourites_by_views, popular_favourites
113 114 115 |
# File 'lib/stacked/user.rb', line 113 def popular_favorites(={}) parse_questions(request(singular(id) + "favorites/views", )) end |
#questions(options = {}) ⇒ Object
139 140 141 |
# File 'lib/stacked/user.rb', line 139 def questions(={}) parse_questions(request(singular(id) + "questions", )) end |
#questions_by_views(options = {}) ⇒ Object
143 144 145 |
# File 'lib/stacked/user.rb', line 143 def questions_by_views(={}) parse_questions(request(singular(id) + "questions/views", )) end |
#questions_by_votes(options = {}) ⇒ Object Also known as: popular_questions
147 148 149 |
# File 'lib/stacked/user.rb', line 147 def questions_by_votes(={}) parse_questions(request(singular(id) + "questions/votes", )) end |
#recent_comments(options = {}) ⇒ Object
Paginated comments for this user ordered by date created.
91 92 93 |
# File 'lib/stacked/user.rb', line 91 def recent_comments(={}) parse_comments(request(singular(id) + "comments/recent", )) end |
#recent_favorites(options = {}) ⇒ Object
120 121 122 |
# File 'lib/stacked/user.rb', line 120 def recent_favorites(={}) parse_questions(request(singular(id) + "favorites/recent", )) end |
#recent_questions(options = {}) ⇒ Object
153 154 155 |
# File 'lib/stacked/user.rb', line 153 def recent_questions(={}) parse_questions(request(singular(id) + "questions/recent", )) end |
#reputations(options = {}) ⇒ Object
Other stuff #
161 162 163 |
# File 'lib/stacked/user.rb', line 161 def reputations(={}) parse_reputations(request(singular(id) + "reputation", )) end |
#tags(options = {}) ⇒ Object
173 174 175 |
# File 'lib/stacked/user.rb', line 173 def (={}) (request(singular(id) + "tags", )) end |
#timeline(options = {}) ⇒ Object
179 180 181 |
# File 'lib/stacked/user.rb', line 179 def timeline(={}) parse_user_timeline(request(singular(id) + "timeline", )) end |