Class: Mihari::Analyzers::HunterHow
- Inherits:
-
Base
- Object
- Mihari::Actor
- Base
- Mihari::Analyzers::HunterHow
- Defined in:
- lib/mihari/analyzers/hunterhow.rb
Overview
hunter.how analyzer
Constant Summary
Constants included from Concerns::Retriable
Concerns::Retriable::DEFAULT_CONDITION, Concerns::Retriable::RETRIABLE_ERRORS
Instance Attribute Summary collapse
- #api_key ⇒ String? readonly
- #end_time ⇒ Date readonly
- #start_time ⇒ Date readonly
Attributes inherited from Base
Attributes inherited from Mihari::Actor
Instance Method Summary collapse
- #artifacts ⇒ Array<Mihari::Models::Artifact>
-
#initialize(query, start_time: nil, end_time: nil, options: nil, api_key: nil) ⇒ HunterHow
constructor
A new instance of HunterHow.
Methods inherited from Base
#call, from_params, #ignore_error?, inherited, #normalized_artifacts, #pagination_interval, #pagination_limit, #parallel?, #result, #truncated_query
Methods inherited from Mihari::Actor
#call, configuration_keys, key, key_aliases, keys, #result, #retry_exponential_backoff, #retry_interval, #retry_times, #timeout, type, #validate_configuration!
Methods included from Concerns::Retriable
Methods included from Concerns::Configurable
#configuration_keys?, #configured?
Constructor Details
#initialize(query, start_time: nil, end_time: nil, options: nil, api_key: nil) ⇒ HunterHow
Returns a new instance of HunterHow.
25 26 27 28 29 30 31 32 |
# File 'lib/mihari/analyzers/hunterhow.rb', line 25 def initialize(query, start_time: nil, end_time: nil, options: nil, api_key: nil) super(query, options:) @api_key = api_key || Mihari.config.hunterhow_api_key @start_time = start_time @end_time = end_time end |
Instance Attribute Details
#api_key ⇒ String? (readonly)
10 11 12 |
# File 'lib/mihari/analyzers/hunterhow.rb', line 10 def api_key @api_key end |
#end_time ⇒ Date (readonly)
16 17 18 |
# File 'lib/mihari/analyzers/hunterhow.rb', line 16 def end_time @end_time end |
#start_time ⇒ Date (readonly)
13 14 15 |
# File 'lib/mihari/analyzers/hunterhow.rb', line 13 def start_time @start_time end |
Instance Method Details
#artifacts ⇒ Array<Mihari::Models::Artifact>
37 38 39 40 41 42 43 44 45 |
# File 'lib/mihari/analyzers/hunterhow.rb', line 37 def artifacts client.search_with_pagination( query, start_time: start_time.strftime("%Y-%m-%d"), end_time: end_time.strftime("%Y-%m-%d") ).map do |res| res.data.artifacts end.flatten end |