Class: Geocoder::Result::Ipqualityscore

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/ipqualityscore.rb

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#coordinates, #country_code, #initialize, #latitude, #longitude, #province, #province_code, #state

Constructor Details

This class inherits a constructor from Geocoder::Result::Base

Class Method Details

.key_method_mappingsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/geocoder/results/ipqualityscore.rb', line 7

def self.key_method_mappings
  {
    'request_id' => :request_id,
    'success' => :success?,
    'message' => :message,
    'city' => :city,
    'region' => :state,
    'country_code' => :country_code,
    'mobile' => :mobile?,
    'fraud_score' => :fraud_score,
    'ISP' => :isp,
    'ASN' => :asn,
    'organization' => :organization,
    'is_crawler' => :crawler?,
    'host' => :host,
    'proxy' => :proxy?,
    'vpn' => :vpn?,
    'tor' => :tor?,
    'active_vpn' => :active_vpn?,
    'active_tor' => :active_tor?,
    'recent_abuse' => :recent_abuse?,
    'bot_status' => :bot?,
    'connection_type' => :connection_type,
    'abuse_velocity' => :abuse_velocity,
    'timezone' => :timezone,
  }
end

Instance Method Details

#addressObject



48
49
50
# File 'lib/geocoder/results/ipqualityscore.rb', line 48

def address
  [city, state, country_code].compact.reject(&:empty?).join(', ')
end

#postal_codeObject



44
45
46
# File 'lib/geocoder/results/ipqualityscore.rb', line 44

def postal_code
  '' # No suitable fallback
end