Sha256: 5e56876e3d6e62b2d1b740383bbc12e94c2b3a1ebddf6cbfeec5663b50975872
Contents?: true
Size: 543 Bytes
Versions: 16
Compression:
Stored size: 543 Bytes
Contents
# frozen_string_literal: true require "normalize_country" module Mihari class Geolocation < ActiveRecord::Base belongs_to :artifact class << self # # Build Geolocation # # @param [String] ip # # @return [Mihari::Geolocation, nil] # def build_by_ip(ip) res = Enrichers::IPInfo.query(ip) unless res.nil? return new(country: NormalizeCountry(res.country_code, to: :short), country_code: res.country_code) end nil end end end end
Version data entries
16 entries across 16 versions & 1 rubygems