Class: Mihari::Analyzers::Onyphe
- Defined in:
- lib/mihari/analyzers/onyphe.rb
Constant Summary
Constants included from Mixins::Retriable
Instance Attribute Summary collapse
- #api_key ⇒ String? readonly
Attributes inherited from Base
Instance Method Summary collapse
- #artifacts ⇒ Object
-
#initialize(*args, **kwargs) ⇒ Onyphe
constructor
A new instance of Onyphe.
Methods inherited from Base
inherited, #normalized_artifacts, #run, #run_emitter, #source
Methods included from Mixins::Retriable
Methods included from Mixins::Configurable
#configuration_values, #configured?
Methods included from Mixins::AutonomousSystem
Constructor Details
#initialize(*args, **kwargs) ⇒ Onyphe
Returns a new instance of Onyphe.
16 17 18 19 20 |
# File 'lib/mihari/analyzers/onyphe.rb', line 16 def initialize(*args, **kwargs) super(*args, **kwargs) @api_key = kwargs[:api_key] || Mihari.config.onyphe_api_key end |
Instance Attribute Details
#api_key ⇒ String? (readonly)
14 15 16 |
# File 'lib/mihari/analyzers/onyphe.rb', line 14 def api_key @api_key end |
Instance Method Details
#artifacts ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/mihari/analyzers/onyphe.rb', line 22 def artifacts responses = search return [] unless responses results = responses.map(&:results).flatten results.map do |result| build_artifact result end end |