Class: Serel::User
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#[], #[]=, #all, associations, attribute, config, #find, finder_methods, #get, #initialize, #inspect, #meth, method_missing, #network, network_wide, new_relation, request, respond_to?, #type, with_ids
Constructor Details
This class inherits a constructor from Serel::Base
Class Method Details
.elected_moderators ⇒ Object
40
41
42
|
# File 'lib/serel/user.rb', line 40
def self.elected_moderators
url("users/moderators/elected")
end
|
.moderators ⇒ Object
36
37
38
|
# File 'lib/serel/user.rb', line 36
def self.moderators
url("users/moderators")
end
|
Instance Method Details
#answers ⇒ Object
44
45
46
|
# File 'lib/serel/user.rb', line 44
def answers
type(:answer).url("users/#{id}/answers")
end
|
#badges ⇒ Object
48
49
50
|
# File 'lib/serel/user.rb', line 48
def badges
type(:badge).url("users/#{id}/badges")
end
|
52
53
54
55
56
57
58
|
# File 'lib/serel/user.rb', line 52
def (to_id = nil)
if to_id
type(:comment).url("users/#{id}/comments/#{to_id}")
else
type(:comment).url("users/#{id}/comments")
end
end
|
#favorites ⇒ Object
60
61
62
|
# File 'lib/serel/user.rb', line 60
def favorites
type(:question).url("users/#{id}/favorites")
end
|
#mentioned ⇒ Object
64
65
66
|
# File 'lib/serel/user.rb', line 64
def mentioned
type(:comment).url("users/#{id}/mentioned")
end
|
#privileges ⇒ Object
68
69
70
|
# File 'lib/serel/user.rb', line 68
def privileges
type(:privilege).url("users/#{id}/privileges")
end
|
#questions ⇒ Object
72
73
74
|
# File 'lib/serel/user.rb', line 72
def questions
type(:question).url("users/#{id}/questions")
end
|
#questions_featured ⇒ Object
76
77
78
|
# File 'lib/serel/user.rb', line 76
def questions_featured
type(:question).url("users/#{id}/questions/featured")
end
|
#questions_no_answers ⇒ Object
80
81
82
|
# File 'lib/serel/user.rb', line 80
def questions_no_answers
type(:question).url("users/#{id}/questions/no-answers")
end
|
#questions_unaccepted ⇒ Object
84
85
86
|
# File 'lib/serel/user.rb', line 84
def questions_unaccepted
type(:question).url("users/#{id}/questions/unaccepted")
end
|
#questions_unanswered ⇒ Object
88
89
90
|
# File 'lib/serel/user.rb', line 88
def questions_unanswered
type(:question).url("users/#{id}/questions/unanswered")
end
|
#reputation ⇒ Object
92
93
94
|
# File 'lib/serel/user.rb', line 92
def reputation
type(:reputation).url("users/#{id}/reputation")
end
|
#suggested_edits ⇒ Object
96
97
98
|
# File 'lib/serel/user.rb', line 96
def suggested_edits
type(:suggested_edit).url("users/#{id}/suggested-edits")
end
|
100
101
102
|
# File 'lib/serel/user.rb', line 100
def tags
type(:tag).url("users/#{id}/tags")
end
|
#top_answers_on(*tags) ⇒ Object
104
105
106
107
|
# File 'lib/serel/user.rb', line 104
def top_answers_on(*tags)
arg = tags.length > 1 ? tags.join(";") : tags.pop
type(:answer).url("users/#{id}/tags/#{arg}/top-answers")
end
|
#top_questions_on(*tags) ⇒ Object
109
110
111
112
|
# File 'lib/serel/user.rb', line 109
def top_questions_on(*tags)
arg = tags.length > 1 ? tags.join(";") : tags.pop
type(:question).url("users/#{id}/tags/#{arg}/top-questions")
end
|