Module: VirusTotal::Client::Action::Comments

Included in:
Domain, File, IPAddress, URL
Defined in:
lib/virustotal/clients/actions/comments.rb

Instance Method Summary collapse

Instance Method Details

#add_comment(id, text) ⇒ Hash

Add a comment to an object

Parameters:

  • id (String)

    Object identifier

  • text (String)

Returns:

  • (Hash)


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

def add_comment(id, text)
  id = to_id(id)
  params = {
    data: {
      type: "comment",
      attributes: {
        text: text
      }
    }
  }
  _post("/#{name}/#{id}/comments", params) { |json| json }
end

#comments(id) ⇒ Hash

Retrieve comments for an object

Parameters:

  • id (String)

    Object identifier

Returns:

  • (Hash)


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

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