Sha256: a87273d9cf8d8247405de64a8703dab56e39dd1322f3815ea1ddcd814951c553
Contents?: true
Size: 587 Bytes
Versions: 8
Compression:
Stored size: 587 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:) } end.value_or [] end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems