You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: maxminddb.rb
    path of file: ./repos/maxminddb/lib
    
    the code of the file until where you have to start completion: require_relative "maxminddb/version"
require_relative 'maxminddb/result'
    
    def addr_from_ip(ip_or_hostname)
      klass = ip_or_hostname.class

      return ip_or_hostname if RUBY_VERSION.to_f < 2.4 && (klass == Fixnum || klass == Bignum)
      return ip_or_hostname if RUBY_VERSION.to_f >= 2.4 && klass == Integer

      addr = IPAddr.new(ip_or_hostname)
      addr = addr.ipv4_mapped if addr.ipv4?
      addr.to_i
    end