Class: Quandora::Answer
Instance Attribute Summary
Attributes inherited from Request
#api, #params
Instance Method Summary
collapse
Methods inherited from Request
#index, #initialize, #show
Instance Method Details
#accept(answer_id, args) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/quandora/answer.rb', line 16
def accept(answer_id, args)
args = args.stringify_keys
body = {
"type": "boolean",
"data": args["accept"]
}
resp = @conn.post("a/#{id}/accept") do |req|
req.body = body.to_json
req.['Content-Type'] = 'application/json'
end
end
|
30
31
32
|
# File 'lib/quandora/answer.rb', line 30
def (answer_id)
Comment.new(@conn, "a", answer_id)
end
|
#vote(answer_id, args) ⇒ Object
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/quandora/answer.rb', line 2
def vote(answer_id, args)
args = args.stringify_keys
body = {
"type": "boolean",
"data": args["vote"]
}
resp = @conn.post("a/#{id}/vote") do |req|
req.body = body.to_s
req.['Content-Type'] = 'application/json'
end
end
|