lib/mihari/models/artifact.rb in mihari-5.7.2 vs lib/mihari/models/artifact.rb in mihari-6.0.0

- old
+ new

@@ -76,44 +76,44 @@ decayed_at = base_time - (artifact_lifetime || -1).seconds artifact.created_at < decayed_at end # - # Enrich(add) whois record + # Enrich whois record # # @param [Mihari::Enrichers::Whois] enricher # def enrich_whois(enricher = Enrichers::Whois.new) return unless can_enrich_whois? self.whois_record = WhoisRecord.build_by_domain(normalize_as_domain(data), enricher: enricher) end # - # Enrich(add) DNS records + # Enrich DNS records # # @param [Mihari::Enrichers::GooglePublicDNS] enricher # def enrich_dns(enricher = Enrichers::GooglePublicDNS.new) return unless can_enrich_dns? self.dns_records = DnsRecord.build_by_domain(normalize_as_domain(data), enricher: enricher) end # - # Enrich(add) reverse DNS names + # Enrich reverse DNS names # # @param [Mihari::Enrichers::Shodan] enricher # def enrich_reverse_dns(enricher = Enrichers::Shodan.new) return unless can_enrich_revese_dns? self.reverse_dns_names = ReverseDnsName.build_by_ip(data, enricher: enricher) end # - # Enrich(add) geolocation + # Enrich geolocation # # @param [Mihari::Enrichers::IPInfo] enricher # def enrich_geolocation(enricher = Enrichers::IPInfo.new) return unless can_enrich_geolocation? @@ -190,12 +190,10 @@ # # @param [Mihari::Enrichers::Base] enricher # def enrich_by_enricher(enricher) methods = ENRICH_METHODS_BY_ENRICHER[enricher.class] || [] - methods.each do |method| - send(method, enricher) if respond_to?(method) - end + methods.each { |method| send(method, enricher) if respond_to?(method) } end private def normalize_as_domain(url_or_domain)