Sha256: ac4e88eab79a99c06b57413cc9d577005ddd1a3aa569ad3b9d4640016da62d0d

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

class Quandora::Answer < Quandora::Request
  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.headers['Content-Type'] = 'application/json'
    end
  end

  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.headers['Content-Type'] = 'application/json'
    end
  end

  def comment(answer_id)
    Comment.new(@conn, "a", answer_id)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quandora-0.3.0 lib/quandora/answer.rb