Sha256: 0c78cb1b4b943d6c6e06d9cc0fb5f8030d1634daad2f1d366b4b89c1ff299147

Contents?: true

Size: 687 Bytes

Versions: 12

Compression:

Stored size: 687 Bytes

Contents

module Zype
  # This class does not support all, create, update or delete methods.
  # Read more at https://docs.zype.com/v1.0/reference#getgeoip-1
  #
  # @since 0.10.0
  class GeoIp < Zype::BaseModel
    %i[all create update delete].each do |mtd|
      send(:define_method, mtd) do
        raise NoMethodError
      end
    end
    
    # Retrieve the GeoIP object for a specific IP Address
    #
    # @param ip_address [String] value for the IP Adress you want to look up
    # @return [Hash]
    def find(ip_address:)
      client.execute(method: :get, path: "/#{path}", params: { ip_address: ip_address })
    end

    private

    def path
      @path = 'geoip'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
zype-0.20.0 lib/zype/models/geo_ip.rb
zype-0.19.0 lib/zype/models/geo_ip.rb
zype-0.18.0 lib/zype/models/geo_ip.rb
zype-0.17.0 lib/zype/models/geo_ip.rb
zype-0.16.1 lib/zype/models/geo_ip.rb
zype-0.16.0 lib/zype/models/geo_ip.rb
zype-0.15.0 lib/zype/models/geo_ip.rb
zype-0.14.0 lib/zype/models/geo_ip.rb
zype-0.13.0 lib/zype/models/geo_ip.rb
zype-0.12.0 lib/zype/models/geo_ip.rb
zype-0.11.0 lib/zype/models/geo_ip.rb
zype-0.10.0 lib/zype/models/geo_ip.rb