Class: Mihari::Clients::PulseDive
- Defined in:
- lib/mihari/clients/publsedive.rb
Overview
PulseDive API client
Instance Attribute Summary collapse
- #api_key ⇒ String readonly
Attributes inherited from Base
#base_url, #headers, #pagination_interval, #timeout
Instance Method Summary collapse
- #get_indicator(ip_or_domain) ⇒ Hash
- #get_properties(indicator_id) ⇒ Hash
-
#initialize(base_url = "https://pulsedive.com", api_key:, headers: {}, timeout: nil) ⇒ PulseDive
constructor
A new instance of PulseDive.
Constructor Details
#initialize(base_url = "https://pulsedive.com", api_key:, headers: {}, timeout: nil) ⇒ PulseDive
Returns a new instance of PulseDive.
18 19 20 21 22 23 24 |
# File 'lib/mihari/clients/publsedive.rb', line 18 def initialize(base_url = "https://pulsedive.com", api_key:, headers: {}, timeout: nil) raise(ArgumentError, "api_key is required") unless api_key @api_key = api_key super(base_url, headers: headers, timeout: timeout) end |
Instance Attribute Details
#api_key ⇒ String (readonly)
10 11 12 |
# File 'lib/mihari/clients/publsedive.rb', line 10 def api_key @api_key end |
Instance Method Details
#get_indicator(ip_or_domain) ⇒ Hash
31 32 33 |
# File 'lib/mihari/clients/publsedive.rb', line 31 def get_indicator(ip_or_domain) get_json "/api/info.php", params: { indicator: ip_or_domain, key: api_key } end |
#get_properties(indicator_id) ⇒ Hash
40 41 42 |
# File 'lib/mihari/clients/publsedive.rb', line 40 def get_properties(indicator_id) get_json "/api/info.php", params: { iid: indicator_id, get: "properties", key: api_key } end |