Sha256: 541b336e979641f2aae116f7d84846b898801d4c3f754b9894739ef05bae03ec
Contents?: true
Size: 592 Bytes
Versions: 14
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true module Mihari module Models # # Port model # class Port < ActiveRecord::Base belongs_to :artifact class << self # # Build ports # # @param [String] ip # @param [Mihari::Enrichers::Shodan] enricher # # @return [Array<Mihari::Port>] # 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 end end end end
Version data entries
14 entries across 14 versions & 1 rubygems