ruqqus 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aef052e6ba89775ce82f8d1474b12b74a0ec84260ae5abcb41b2c098e1befbf2
4
- data.tar.gz: 79385f50df81574939d19746d8f36e9e66e075553ec980c5daa0d411cd27e60c
3
+ metadata.gz: 4c14af41785a17ac1c28bc3e89f778a1ce64571a2943e9ca44d4f5370c502de8
4
+ data.tar.gz: b7e33784b89a2df20e85ead8e7097ab53b48d3bf95311f9ef1555a04bc91a975
5
5
  SHA512:
6
- metadata.gz: 2039cc29cfde59766c5d249c74b49c132b709db04553848d5e8915df242dc276f2b550289bc43b58b322987851e747feede7dbe7ee89ba5ef9f0e6c096afa546
7
- data.tar.gz: d62ca8506d89f4c8e772fa24daf57c0dca3e6d90c57a473a82eb6b0e89c10ab564058c198c5fb75d038c573b8792945d51633e440857322b2d64f8dc6867386c
6
+ metadata.gz: a8557e744ce587f4d30c01b3ba954cec4eba4e5b3cd51ab408c202b4b3d6038f4db5e92f02d4667a7b289738d0efc5e578528535105877fb847c735eac162eb2
7
+ data.tar.gz: f421f465e5690496b21050950c6a177b01c7724b67752ae896aaf7ef500c972c0643bb88b82c0562285ed7bb4b9f82f8461e1677f2f212dbf25847e474e7649a
@@ -2,6 +2,10 @@
2
2
 
3
3
  Documentation for library API changes.
4
4
 
5
+ ## Version 1.1.2
6
+
7
+ * Implemented enumerating comments of guilds and posts
8
+
5
9
  ## Version 1.1.1
6
10
 
7
11
  * BUGFIX: Added acceptance of variable args to `Token#to_json`
data/README.md CHANGED
@@ -41,7 +41,7 @@ To use the `ruqqus-oauth` helper to generate user tokens for desktop development
41
41
 
42
42
  Ruqqus enables 3rd-party client authorization using the [OAuth2 protocol](https://oauth.net/2/). Before it is possible
43
43
  to interact with the API, you will need to first [register an application](https://ruqqus.com/settings/apps), which can
44
- be supply you with an API key/secret pair. This key will allow you to authorize users and grant privileges with a an
44
+ be supply you with an API key/secret pair. This key will allow you to authorize users and grant privileges with an
45
45
  assortment of scopes to fit your needs.
46
46
 
47
47
  ### Desktop Development
data/TODO.md CHANGED
@@ -8,8 +8,6 @@ A scratch pad for things to do and ideas to look into
8
8
  * Update README with more examples
9
9
  * Create wiki on GitHub
10
10
  * Finish and cleanup and `ruqqus-oauth` app
11
- * Groups in documentation
12
- * Front page method?
13
11
  * Embed comment/posts API
14
12
 
15
13
  # Missing API features
@@ -44,6 +44,40 @@ module Ruqqus
44
44
  class Error < StandardError
45
45
  end
46
46
 
47
+ ##
48
+ # @!attribute self.proxy [rw]
49
+ # @return [URI?] the URI of the proxy server in use, or `nil` if none has been set.
50
+
51
+ ##
52
+ # Obtains a list of URIs of proxy servers that can be used to route network traffic through.
53
+ #
54
+ # @param anon [Symbol] anonymity filter for the servers to return, either `:transparent`, `:anonymous`, or `:elite`.
55
+ # @param country [String,Symbol] country filter for servers to return, an ISO-3166 two digit county code.
56
+ #
57
+ # @return [Array<URI>] an array of proxy URIs that match the input filters.
58
+ # @see https://www.nationsonline.org/oneworld/country_code_list.htm
59
+ def self.proxy_list(anon: :elite, country: nil)
60
+ raise(ArgumentError, 'invalid anonymity value') unless %i(transparent anonymous elite).include?(anon.to_sym)
61
+
62
+ url = "https://www.proxy-list.download/api/v1/get?type=https&anon=#{anon}"
63
+ url << "&country=#{country}" if country
64
+
65
+ RestClient.get(url) do |resp|
66
+ break if resp.code != 200
67
+ return resp.body.split.map { |proxy| URI.parse("https://#{proxy}") }
68
+ end
69
+ Array.new
70
+ end
71
+
72
+ def self.proxy
73
+ RestClient.proxy
74
+ end
75
+
76
+ def self.proxy=(uri)
77
+ raise(TypeError, "#{uri} is not a URI") if uri && !uri.is_a?(URI)
78
+ RestClient.proxy = uri
79
+ end
80
+
47
81
  ##
48
82
  # Helper function to automate uploading images to Imgur anonymously and returning the direct image link.
49
83
  #
@@ -146,10 +146,10 @@ module Ruqqus
146
146
  # @note This method is restricted to 6/minute, and will fail when that limit is exceeded.
147
147
  def comment_reply(body, comment)
148
148
  if comment.is_a?(Comment)
149
- comment_submit(comment.full_name, comment.post_id, body)
149
+ comment_submit(comment.fullname, comment.post_id, body)
150
150
  else
151
151
  comment = self.comment(comment.to_s)
152
- comment_submit(comment.full_name, comment.post_id, body)
152
+ comment_submit(comment.fullname, comment.post_id, body)
153
153
  end
154
154
  end
155
155
 
@@ -323,6 +323,54 @@ module Ruqqus
323
323
  self
324
324
  end
325
325
 
326
+ ##
327
+ # Enumerates through each comment in a guild, yielding each to a block.
328
+ #
329
+ # @param guild [Guild,String] a {Guild} instance, or the name of the guild to query.
330
+ # @yieldparam [Comment] yields a {Comment} to the block.
331
+ #
332
+ # @return [self]
333
+ # @raise [LocalJumpError] when a block is not supplied to the method.
334
+ def each_guild_comment(guild)
335
+ raise(LocalJumpError, 'block required') unless block_given?
336
+ name = guild.to_s
337
+ raise(ArgumentError, 'invalid guild name') unless Ruqqus::VALID_GUILD.match?(name)
338
+
339
+ page = 1
340
+ loop do
341
+ params = { page: page }
342
+ json = http_get("#{Routes::GUILD}#{name}/comments", headers(params: params))
343
+ break if json[:error]
344
+
345
+ json[:data].each { |hash| yield Comment.from_json(hash) }
346
+ break if json[:data].size < 25
347
+ page += 1
348
+ end
349
+
350
+ self
351
+ end
352
+
353
+ ##
354
+ # Enumerates through each comment in a guild, yielding each to a block.
355
+ #
356
+ # @param post [Post,String] a {Post} instance, or the unique ID of the post to query.
357
+ # @yieldparam [Comment] yields a {Comment} to the block.
358
+ #
359
+ # @return [self]
360
+ # @raise [LocalJumpError] when a block is not supplied to the method.
361
+ # @note This method is very inefficient, as it the underlying API does not yet implement it, therefore each comment
362
+ # in the entire guild must be searched through.
363
+ def each_post_comment(post)
364
+ # TODO: This is extremely inefficient, but will have to do until it gets implemented in the API
365
+ raise(LocalJumpError, 'block required') unless block_given?
366
+ post = self.post(post) unless post.is_a?(Post)
367
+ each_guild_comment(post.guild_name) do |comment|
368
+ next unless comment.post_id == post.id
369
+ yield comment
370
+ end
371
+ self
372
+ end
373
+
326
374
  ##
327
375
  # Enumerates through every post on Ruqqus, yielding each post to a block.
328
376
  #
@@ -111,7 +111,7 @@ module Ruqqus
111
111
  ##
112
112
  # Loads the object from a JSON-formatted string.
113
113
  #
114
- # @param json [String,Hash] a JSON string representing the object, or the parsed Hash of the JSON data.
114
+ # @param json [String,Hash] a JSON string representing the object, or the parsed Hash of the JSON (symbol keys).
115
115
  #
116
116
  # @return [Object] the loaded object.
117
117
  def self.from_json(payload)
@@ -6,31 +6,37 @@ module Ruqqus
6
6
  class Comment < Submission
7
7
 
8
8
  ##
9
- # @return [Integer] the level of "nesting" in the comment tree, starting at `1` when in direct reply to the post.
10
- def level
11
- @data[:level]
12
- end
9
+ # @!attribute [r] level
10
+ # @return [Integer] the level of "nesting" in the comment tree, starting at `1` when in direct reply to the post.
13
11
 
14
12
  ##
15
- # @return [String] the unique ID of the parent for this comment.
16
- def parent_id
17
- @data[:parent]
18
- end
13
+ # @!attribute parent_id
14
+ # @return [String] the unique ID of the parent for this comment.
15
+
16
+ ##
17
+ # @!attribute [r] post_id
18
+ # @return [String] the ID of the post this comment belongs to.
19
19
 
20
20
  ##
21
- # @return [Boolean] `true` if {#parent_id} refers to a comment, otherwise `false` if a post.
21
+ # @return [Boolean] `true` if the comment's parent is comment, otherwise `false` if it is a post.
22
22
  def parent_comment?
23
23
  level > 1
24
24
  end
25
25
 
26
26
  ##
27
- # @return [Boolean] `true` if {#parent_id} refers to a post, otherwise `false` if a comment.
27
+ # @return [Boolean] `true` if the comment's parent is post, otherwise `false` if it is a comment.
28
28
  def parent_post?
29
29
  level == 1
30
30
  end
31
31
 
32
- ##
33
- # @return [String] the ID of the post this comment belongs to.
32
+ def level
33
+ @data[:level]
34
+ end
35
+
36
+ def parent_id
37
+ @data[:parent]
38
+ end
39
+
34
40
  def post_id
35
41
  @data[:post]
36
42
  end
@@ -5,28 +5,40 @@ module Ruqqus
5
5
  class Guild < ItemBase
6
6
 
7
7
  ##
8
- # @return [String] the name of the guild.
9
- def name
10
- @data[:name]
11
- end
8
+ # @!attribute [r] name
9
+ # @return [String] the name of the guild.
12
10
 
13
11
  ##
14
- # @return [Integer] the number of members subscribed to the guild.
15
- def member_count
16
- @data[:subscriber_count]&.to_i || 0
17
- end
12
+ # @!attribute [r] member_count
13
+ # @return [Integer] the number of members subscribed to the guild.
18
14
 
19
15
  ##
20
- # @return [Integer] the number of guild masters who moderate this guild.
21
- def gm_count
22
- @data[:mods_count]&.to_i || 0
23
- end
16
+ # @!attribute [r] fullname
17
+ # @return [String] the full ID of the guild.
24
18
 
25
19
  ##
26
- # @return [String] the full ID of the guild.
27
- def full_name
28
- @data[:fullname]
29
- end
20
+ # @!attribute [r] guildmaster_count
21
+ # @return [Integer] the number of guild masters who moderate this guild.
22
+
23
+ ##
24
+ # @!attribute [r] profile_url
25
+ # @return [String] the URL for the profile image associated with the guild.
26
+
27
+ ##
28
+ # @!attribute [r] color
29
+ # @return [String] the accent color used for the guild, in HTML format.
30
+
31
+ ##
32
+ # @!attribute [r] description
33
+ # @return [String] the description of the guild.
34
+
35
+ ##
36
+ # @!attribute [r] description_html
37
+ # @return [String] the description of the guild in HTML format.
38
+
39
+ ##
40
+ # @!attribute [r] banner_url
41
+ # @return [String] the URL for the banner image associated with the guild.
30
42
 
31
43
  ##
32
44
  # @return [Boolean] `true` if the guild contains adult content and flagged as NSFW, otherwise `false`.
@@ -47,39 +59,45 @@ module Ruqqus
47
59
  end
48
60
 
49
61
  ##
50
- # @return [String] the description of the guild.
51
- def description
52
- @data[:description]
62
+ # @return [String] the string representation of the object.
63
+ def to_s
64
+ @data[:name] || inspect
53
65
  end
54
66
 
55
- ##
56
- # @return [String] the description of the guild in HTML format.
57
- def description_html
58
- @data[:description_html]
67
+ def description
68
+ @data[:description]
59
69
  end
60
70
 
61
- ##
62
- # @return [String] the URL for the banner image associated with the guild.
63
71
  def banner_url
64
72
  @data[:banner_url]
65
73
  end
66
74
 
67
- ##
68
- # @return [String] the URL for the profile image associated with the guild.
75
+ def description_html
76
+ @data[:description_html]
77
+ end
78
+
69
79
  def profile_url
70
80
  @data[:profile_url]
71
81
  end
72
82
 
73
- ##
74
- # @return [String] the accent color used for the guild, in HTML format.
75
83
  def color
76
84
  @data[:color]
77
85
  end
78
86
 
79
- ##
80
- # @return [String] the string representation of the object.
81
- def to_s
82
- @data[:name] || inspect
87
+ def name
88
+ @data[:name]
89
+ end
90
+
91
+ def member_count
92
+ @data[:subscriber_count]&.to_i || 0
93
+ end
94
+
95
+ def guildmaster_count
96
+ @data[:mods_count]&.to_i || 0
97
+ end
98
+
99
+ def fullname
100
+ @data[:fullname]
83
101
  end
84
102
  end
85
103
  end
@@ -6,6 +6,22 @@ module Ruqqus
6
6
  # Base class for all all major API types.
7
7
  class ItemBase
8
8
 
9
+ ##
10
+ # @!attribute [r] permalink
11
+ # @return [String] a relative link to this item.
12
+
13
+ ##
14
+ # @!attribute [r] created_utc
15
+ # @return [Integer] the time the item was created, in seconds since the Unix epoch.
16
+
17
+ ##
18
+ # @!attribute [r] created
19
+ # @return [Time] the time the item was created.
20
+
21
+ ##
22
+ # @!attribute [r] id
23
+ # @return [String] a unique ID for this item.
24
+
9
25
  ##
10
26
  # @return [Boolean] `true` if item has been banned, otherwise `false`.
11
27
  def banned?
@@ -13,31 +29,23 @@ module Ruqqus
13
29
  end
14
30
 
15
31
  ##
16
- # @return [Integer] the time the item was created, in seconds since the Unix epoch.
32
+ # @return [Boolean] `true` if this object is equal to another, otherwise `false`.
33
+ def ==(other)
34
+ self.class == other.class && id == other.id
35
+ end
36
+
17
37
  def created_utc
18
38
  @data[:created_utc]
19
39
  end
20
40
 
21
- ##
22
- # @return [Time] the time the item was created.
23
41
  def created
24
42
  Time.at(created_utc)
25
43
  end
26
44
 
27
- ##
28
- # @return [String] a unique ID for this item.
29
45
  def id
30
46
  @data[:id]
31
47
  end
32
48
 
33
- ##
34
- # @return [Boolean] `true` if this object is equal to another, otherwise `false`.
35
- def ==(other)
36
- self.class == other.class && id == other.id
37
- end
38
-
39
- ##
40
- # @return [String] a relative link to this item.
41
49
  def permalink
42
50
  @data[:permalink]
43
51
  end
@@ -6,44 +6,62 @@ module Ruqqus
6
6
  class Post < Submission
7
7
 
8
8
  ##
9
- # @return [Title?] the title assigned to the author, or `nil` if none is defined.
9
+ # @!attribute [r] thumb_url
10
+ # @return [String?] the URL of the post's thumbnail image, or `nil` if none exists.
11
+
12
+ ##
13
+ # @!attribute [r] url
14
+ # @return [String?] the URL the post links to, or `nil` if none is specified.
15
+
16
+ ##
17
+ # @!attribute [r] author_title
18
+ # @return [Title?] the title assigned to the author, or `nil` if none is defined.
19
+
20
+ ##
21
+ # @!attribute [r] comment_count
22
+ # @return [Integer] the number of comments made on the post.
23
+
24
+ ##
25
+ # @!attribute [r] domain
26
+ # @return [String] the domain name for link posts, otherwise a short descriptor of the post type.
27
+
28
+ ##
29
+ # @!attribute [r] embed_url
30
+ # @return [String] the embed URL for the post.
31
+
32
+ ##
33
+ # @!attribute [r] original_guild_name
34
+ # @return [String] the name of the guild this post was originally posted in.
35
+
36
+ # @@!attribute [r] title
37
+ # @return [String] the post title.
38
+
39
+
10
40
  def author_title
11
- #noinspection RubyYardReturnMatch
41
+ #noinspection RubyYardReturnMatch,RubyResolve
12
42
  @author_title ||= @data[:author_title] ? Title.new(@data[:author_title]) : nil
13
43
  end
14
44
 
15
- ##
16
- # @return [Integer] the number of comments made on the post.
17
45
  def comment_count
18
46
  @data[:comment_count]
19
47
  end
20
48
 
21
- ##
22
- # @return [String] the domain name for link posts, otherwise a short descriptor of the post type.
23
49
  def domain
24
50
  @data[:domain]
25
51
  end
26
52
 
27
- ##
28
- # @return [String] the embed URL for the post.
29
53
  def embed_url
30
54
  @data[:embed_url]
31
55
  end
32
56
 
33
- ##
34
- # @return [String] the name of the guild this post was originally posted in.
35
57
  def original_guild_name
36
58
  @data[:original_guild_name]
37
59
  end
38
60
 
39
- ##
40
- # @return [String?] the URL of the post's thumbnail image, or `nil` if none exists.
41
61
  def thumb_url
42
62
  @data[:thumb_url]
43
63
  end
44
64
 
45
- ##
46
- # @return [String?] the URL the post links to, or `nil` if none is specified.
47
65
  def url
48
66
  #noinspection RubyYardReturnMatch
49
67
  @data[:url]&.empty? ? nil : @data[:url]
@@ -7,57 +7,53 @@ module Ruqqus
7
7
  class Submission < ItemBase
8
8
 
9
9
  ##
10
- # @return [String?] the name of the creator of the item, or `nil` if deleted account.
11
- def author_name
12
- @data[:author]
13
- end
10
+ # @!attribute [r] title
11
+ # @return [String] the name/title of this item.
14
12
 
15
13
  ##
16
- # @return [String] the text body of the item.
17
- def body
18
- @data[:body]
19
- end
14
+ # @!attribute [r] author_name
15
+ # @return [String?] the name of the creator of the item, or `nil` if deleted account.
20
16
 
21
17
  ##
22
- # @return [String] the text body of the item in HTML format.
23
- def body_html
24
- @data[:body_html]
25
- end
18
+ # @!attribute [r] body
19
+ # @return [String] the text body of the item.
26
20
 
27
21
  ##
28
- # @return [Integer] the time of the last edit in seconds since the Unix epoch, or `0` if never edited.
29
- def last_edit_utc
30
- @data[:edited_utc]
31
- end
22
+ # @!attribute [r] body_html
23
+ # @return [String] the text body of the item in HTML format.
32
24
 
33
25
  ##
34
- # @return [Time] the time of the last edit.
35
- def last_edit
36
- Time.at(@data[:edited_utc])
37
- end
26
+ # @!attribute [r] last_edit_utc
27
+ # @return [Integer] the time of the last edit in seconds since the Unix epoch, or `0` if never edited.
38
28
 
39
29
  ##
40
- # @return [Boolean] `true` if post has been edited, otherwise `false`.
41
- def edited?
42
- @data[:edited_utc] != 0
43
- end
30
+ # @!attribute [r] last_edit
31
+ # @return [Time] the time of the last edit.
44
32
 
45
33
  ##
46
- # @return [Integer] the number of upvotes this item has received.
47
- def upvotes
48
- @data[:upvotes]
49
- end
34
+ # @!attribute [r] upvotes
35
+ # @return [Integer] the number of upvotes this item has received.
50
36
 
51
37
  ##
52
- # @return [Integer] the number of downvotes this item has received.
53
- def downvotes
54
- @data[:downvotes]
55
- end
38
+ # @!attribute [r] downvotes
39
+ # @return [Integer] the number of downvotes this item has received.
56
40
 
57
41
  ##
42
+ # @!attribute [r] score
58
43
  # @return [Integer] a score calculated by adding upvotes and subtracting downvotes.
59
- def score
60
- @data[:score]
44
+
45
+ ##
46
+ # @!attribute [r] fullname
47
+ # @return [String] the full ID of this item.
48
+
49
+ ##
50
+ # @!attribute [r] guild_name
51
+ # @return [String] the name of the guild this item is contained within.
52
+
53
+ ##
54
+ # @return [Boolean] `true` if post has been edited, otherwise `false`.
55
+ def edited?
56
+ @data[:edited_utc] != 0
61
57
  end
62
58
 
63
59
  ##
@@ -91,27 +87,53 @@ module Ruqqus
91
87
  end
92
88
 
93
89
  ##
94
- # @return [String] the full ID of this item.
95
- def full_name
90
+ # @return [String] the string representation of the object.
91
+ def to_s
92
+ @data[:id]
93
+ end
94
+
95
+ def author_name
96
+ @data[:author]
97
+ end
98
+
99
+ def body
100
+ @data[:body]
101
+ end
102
+
103
+ def body_html
104
+ @data[:body_html]
105
+ end
106
+
107
+ def last_edit_utc
108
+ @data[:edited_utc]
109
+ end
110
+
111
+ def last_edit
112
+ Time.at(@data[:edited_utc])
113
+ end
114
+
115
+ def upvotes
116
+ @data[:upvotes]
117
+ end
118
+
119
+ def downvotes
120
+ @data[:downvotes]
121
+ end
122
+
123
+ def score
124
+ @data[:score]
125
+ end
126
+
127
+ def fullname
96
128
  @data[:fullname]
97
129
  end
98
130
 
99
- ##
100
- # @return [String] the name of the guild this item is contained within.
101
131
  def guild_name
102
132
  @data[:guild_name]
103
133
  end
104
134
 
105
- ##
106
- # @return [String] the name/title of this item.
107
135
  def title
108
136
  @data[:title]
109
137
  end
110
-
111
- ##
112
- # @return [String] the string representation of the object.
113
- def to_s
114
- @data[:id]
115
- end
116
138
  end
117
139
  end
@@ -6,31 +6,75 @@ module Ruqqus
6
6
  class User < ItemBase
7
7
 
8
8
  ##
9
- # @return [Integer] the number of comments the user has created.
9
+ # @!attribute [r] comment_count
10
+ # @return [Integer] the number of comments the user has created.
11
+
12
+ ##
13
+ # @!attribute [r] post_count
14
+ # @return [Integer] the number of posts the user has created.
15
+
16
+ ##
17
+ # @!attribute [r] comment_rep
18
+ # @return [Integer] the amount of rep the user has earned from comments.
19
+
20
+ ##
21
+ # @!attribute [r] post_rep
22
+ # @return [Integer] the amount of rep the user has earned from posts.
23
+
24
+ ##
25
+ # @!attribute [r] total_rep
26
+ # @return [Integer] the total amount of rep the user has earned from comments and posts.
27
+
28
+ ##
29
+ # @!attribute [r] badges
30
+ # @return [Array<Badge>] an array of badges associated with this account.
31
+
32
+ ##
33
+ # @!attribute [r] title
34
+ # @return [Title?] the title the user has associated with their account, or `nil` if none is assigned.
35
+
36
+ ##
37
+ # @!attribute [r] banner_url
38
+ # @return [String] the URL for the banner image associated with the account.
39
+
40
+ ##
41
+ # @!attribute [r] profile_url
42
+ # @return [String] the URL for the profile image associated with the account.
43
+
44
+ ##
45
+ # @!attribute [r] bio
46
+ # @return [String] A brief statement/biography the user has associated with their account.
47
+
48
+ ##
49
+ # @!attribute [r] bio_html
50
+ # @return [String] a brief statement/biography the user has associated with their account in HTML format.
51
+
52
+ ##
53
+ # @!attribute [r] ban_reason
54
+ # @return [String?] the reason the user was banned if they were, otherwise `nil`.
55
+
56
+ ##
57
+ # @return [String] the string representation of the object.
58
+ def to_s
59
+ @data[:username] || inspect
60
+ end
61
+
10
62
  def comment_count
11
63
  @data[:comment_count] || 0
12
64
  end
13
65
 
14
- ##
15
- # @return [Integer] the number of posts the user has created.
16
66
  def post_count
17
67
  @data[:post_count] || 0
18
68
  end
19
69
 
20
- ##
21
- # @return [Integer] the amount of rep the user has earned from comments.
22
70
  def comment_rep
23
71
  @data[:comment_rep] || 0
24
72
  end
25
73
 
26
- ##
27
- # @return [Integer] the amount of rep the user has earned from posts.
28
74
  def post_rep
29
75
  @data[:post_rep] || 0
30
76
  end
31
77
 
32
- ##
33
- # @return [Integer] the total amount of rep the user has earned from comments and posts.
34
78
  def total_rep
35
79
  comment_rep + post_rep
36
80
  end
@@ -41,53 +85,34 @@ module Ruqqus
41
85
  @data[:username]
42
86
  end
43
87
 
44
- ##
45
- # @return [Array<Badge>] an array of badges associated with this account.
46
88
  def badges
89
+ #noinspection RubyResolve
47
90
  @badges ||= @data[:badges].map { |b| Badge.new(b) }
48
91
  end
49
92
 
50
- ##
51
- # @return [Title?] the title the user has associated with their account, or `nil` if none is assigned.
52
93
  def title
53
- #noinspection RubyYardReturnMatch
94
+ #noinspection RubyYardReturnMatch,RubyResolve
54
95
  @title ||= @data[:title] ? Title.new(@data[title]) : nil
55
96
  end
56
97
 
57
- ##
58
- # @return [String] the URL for the banner image associated with the account.
59
98
  def banner_url
60
99
  @data[:banner_url]
61
100
  end
62
101
 
63
- ##
64
- # @return [String] the URL for the profile image associated with the account.
65
102
  def profile_url
66
103
  @data[:profile_url]
67
104
  end
68
105
 
69
- ##
70
- # @return [String] A brief statement/biography the user has associated with their account.
71
106
  def bio
72
107
  @data[:bio]
73
108
  end
74
109
 
75
- ##
76
- # @return [String] a brief statement/biography the user has associated with their account in HTML format.
77
110
  def bio_html
78
111
  @data[:bio_html]
79
112
  end
80
113
 
81
- ##
82
- # @return [String?] the reason the user was banned if they were, otherwise `nil`.
83
114
  def ban_reason
84
115
  @data[:ban_reason]
85
116
  end
86
-
87
- ##
88
- # @return [String] the string representation of the object.
89
- def to_s
90
- @data[:username] || inspect
91
- end
92
117
  end
93
118
  end
@@ -2,7 +2,7 @@ module Ruqqus
2
2
 
3
3
  ##
4
4
  # The Ruqqus gem version.
5
- VERSION = '1.1.1'.freeze
5
+ VERSION = '1.1.2'.freeze
6
6
 
7
7
  ##
8
8
  # Lulz
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruqqus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ForeverZer0
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2020-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client