Class: Mihari::Services::AutonomousSystemBuilder

Inherits:
Mihari::Service show all
Defined in:
lib/mihari/services/builders.rb

Overview

Autonomous system builder

Instance Method Summary collapse

Methods inherited from Mihari::Service

call, #result, result

Instance Method Details

#call(ip, enricher: Enrichers::MMDB.new) ⇒ Mihari::Models::AutonomousSystem?

Parameters:

Returns:



34
35
36
37
38
# File 'lib/mihari/services/builders.rb', line 34

def call(ip, enricher: Enrichers::MMDB.new)
  enricher.result(ip).fmap do |res|
    Models::AutonomousSystem.new(asn: res.asn) if res.asn
  end.value_or nil
end