Class: Pulsedive::Threat

Inherits:
Client
  • Object
show all
Defined in:
lib/pulsedive/threat.rb

Constant Summary

Constants inherited from Client

Client::HOST, Client::URL

Instance Attribute Summary

Attributes inherited from Client

#api_key

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Pulsedive::Client

Instance Method Details

#get_by_id(tid) ⇒ Object



3
4
5
6
7
8
# File 'lib/pulsedive/threat.rb', line 3

def get_by_id(tid)
  params = {
    "tid": tid
  }
  get("/api/info.php", params) { |json| json }
end

#get_by_name(tname) ⇒ Object



10
11
12
13
14
15
# File 'lib/pulsedive/threat.rb', line 10

def get_by_name(tname)
  params = {
    "tname": tname
  }
  get("/api/info.php", params) { |json| json }
end

#get_linked_indicators_by_id(tld) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/pulsedive/threat.rb', line 27

def get_linked_indicators_by_id(tld)
  params = {
    "tid": tld,
    "get": "links"
  }
  get("/api/info.php", params) { |json| json }
end

#get_summary_by_id(tld) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/pulsedive/threat.rb', line 17

def get_summary_by_id(tld)
  params = {
    "tid": tld,
    "get": "links",
    "summary": "1",
    "splitrisk": "1"
  }
  get("/api/info.php", params) { |json| json }
end