repltalk 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/repltalk/client.rb +1 -1
- data/lib/repltalk/graphql.rb +1 -1
- data/lib/repltalk/structures.rb +9 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17af54edd0d1552ed38a2f3e971da22cb42eb3540eac53642f2347555284c4b1
|
|
4
|
+
data.tar.gz: 5a30898e823d5d5959b1fe33e2f6508865f6538982c3e605ef83e9e684b4e52a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fa905a802f5bbba4d8f7c3d0ee403b3d7885d8069e04c4e68e73ed8891b0403c2e2e4880f2a2ec0155325556f31ff3f50abc4109d0086bb0abd1065000005d2
|
|
7
|
+
data.tar.gz: 0f319ab29a06dbb6424d9cf71cff28dbaba96951ab537f5f6a5819e4988dc26f734f5b27a3df71aab22307c756ef4fc3a7a9c8ebbbf0e491182d28c846dda9e2
|
data/lib/repltalk/client.rb
CHANGED
data/lib/repltalk/graphql.rb
CHANGED
data/lib/repltalk/structures.rb
CHANGED
|
@@ -380,26 +380,27 @@ module ReplTalk
|
|
|
380
380
|
class Post
|
|
381
381
|
attr_reader :id, :url, :repl, :board, :title, :author, :answer, :content, :preview, :timestamp, :vote_count, :comment_count, :can_vote, :has_voted, :is_answered, :is_answerable, :is_hidden, :is_pinned, :is_locked, :is_announcement
|
|
382
382
|
|
|
383
|
-
def initialize(client, post)
|
|
383
|
+
def initialize(client, post)
|
|
384
384
|
@client = client
|
|
385
385
|
|
|
386
386
|
@id = post["id"]
|
|
387
387
|
@url = $BASE_URL + post["url"]
|
|
388
388
|
@title = post["title"]
|
|
389
389
|
@timestamp = post["timeCreated"]
|
|
390
|
+
|
|
391
|
+
@board = Board.new(post["board"])
|
|
392
|
+
@repl = post["repl"] == nil ? nil : Repl.new(@client, post["repl"])
|
|
393
|
+
@author = post["user"] == nil ? nil : User.new(@client, post["user"])
|
|
394
|
+
@answer = post["answer"] == nil ? nil : Comment.new(@client, post["answer"])
|
|
390
395
|
|
|
391
396
|
@content = post["body"]
|
|
392
397
|
@preview = post["preview"]
|
|
393
398
|
|
|
394
|
-
if @content == ""
|
|
399
|
+
if @content == "" # new post type
|
|
400
|
+
@url = "#{@repl.url}?c=#{post["replComment"]["id"]}"
|
|
395
401
|
@content = post["replComment"]["body"]
|
|
396
402
|
@preview = @content.length > 150 ? @content[0..150] : @content
|
|
397
|
-
end
|
|
398
|
-
|
|
399
|
-
@board = Board.new(post["board"])
|
|
400
|
-
@repl = post["repl"] == nil ? nil : Repl.new(@client, post["repl"])
|
|
401
|
-
@author = post["user"] == nil ? nil : User.new(@client, post["user"])
|
|
402
|
-
@answer = post["answer"] == nil ? nil : Comment.new(@client, post["answer"])
|
|
403
|
+
end
|
|
403
404
|
|
|
404
405
|
@vote_count = post["voteCount"]
|
|
405
406
|
@comment_count = post["commentCount"]
|