Module: VirusTotal::Client::Action::Votes

Included in:
File, URL
Defined in:
lib/virustotal/clients/actions/votes.rb

Instance Method Summary collapse

Instance Method Details

#add_vote(id, verdict) ⇒ Hash

Add a vote for an object

Parameters:

  • id (String)

    Object identifier

  • verdict (String)

    harmless or malicious

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/virustotal/clients/actions/votes.rb', line 27

def add_vote(id, verdict)
  id = to_id(id)
  params = {
    data: {
      type: "vote",
      attributes: {
        verdict: verdict
      }
    }
  }
  _post("/#{name}/#{id}/votes", params) { |json| json }
end

#votes(id) ⇒ Hash

Retrieve votes for an object

Parameters:

  • id (String)

    Object identifier

Returns:

  • (Hash)


14
15
16
17
# File 'lib/virustotal/clients/actions/votes.rb', line 14

def votes(id)
  id = to_id(id)
  _get("/#{name}/#{id}/votes") { |json| json }
end