class Osakana::Enrichers::Enricher

Public Class Methods

new() click to toggle source
# File lib/osakana/enrichers/enricher.rb, line 6
def initialize
  @enrichers = [SecurityTrails.new, Robtex.new]
end

Public Instance Methods

domain_to_ipv4(domain) click to toggle source
# File lib/osakana/enrichers/enricher.rb, line 19
def domain_to_ipv4(domain)
  @enrichers.each do |enricher|
    return enricher.domain_to_ipv4(domain)
  rescue ArgumentError, ::SecurityTrails::Error, ::Robtex::ResponseError => _
    next
  end
  nil
end
ipv4_to_domain(ipv4) click to toggle source
# File lib/osakana/enrichers/enricher.rb, line 10
def ipv4_to_domain(ipv4)
  @enrichers.each do |enricher|
    return enricher.ipv4_to_domain(ipv4)
  rescue ArgumentError, ::SecurityTrails::Error, ::Robtex::ResponseError, URI::InvalidURIError => _
    next
  end
  nil
end