Class: Mihari::Models::Port
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mihari::Models::Port
- Defined in:
- lib/mihari/models/port.rb
Overview
Port model
Class Method Summary collapse
Class Method Details
.build_by_ip(ip, enricher: Enrichers::Shodan.new) ⇒ Array<Mihari::Port>
Build ports
20 21 22 23 24 |
# File 'lib/mihari/models/port.rb', line 20 def build_by_ip(ip, enricher: Enrichers::Shodan.new) enricher.result(ip).fmap do |res| (res&.ports || []).map { |port| new(port: port) } end.value_or [] end |