class Geocoder::Result::Ipregistry
Public Class Methods
new(data)
click to toggle source
Calls superclass method
Geocoder::Result::Base::new
# File lib/geocoder/results/ipregistry.rb, line 6 def initialize(data) super @data = flatten_hash(data) end
Public Instance Methods
carrier_mcc()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 72 def carrier_mcc @data["carrier_mcc"] end
carrier_mnc()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 76 def carrier_mnc @data["carrier_mnc"] end
carrier_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 68 def carrier_name @data["carrier_name"] end
city()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 30 def city @data['location_city'] end
connection_asn()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 80 def connection_asn @data["connection_asn"] end
connection_domain()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 84 def connection_domain @data["connection_domain"] end
connection_organization()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 88 def connection_organization @data["connection_organization"] end
connection_type()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 92 def connection_type @data["connection_type"] end
coordinates()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 12 def coordinates [@data['location_latitude'], @data['location_longitude']] end
country()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 34 def country @data['location_country_name'] end
country_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 38 def country_code @data['location_country_code'] end
currency_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 96 def currency_code @data["currency_code"] end
currency_format_negative_prefix()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 116 def currency_format_negative_prefix @data["currency_format_negative_prefix"] end
currency_format_negative_suffix()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 120 def currency_format_negative_suffix @data["currency_format_negative_suffix"] end
currency_format_positive_prefix()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 124 def currency_format_positive_prefix @data["currency_format_positive_prefix"] end
currency_format_positive_suffix()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 128 def currency_format_positive_suffix @data["currency_format_positive_suffix"] end
currency_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 100 def currency_name @data["currency_name"] end
currency_plural()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 104 def currency_plural @data["currency_plural"] end
currency_symbol()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 108 def currency_symbol @data["currency_symbol"] end
currency_symbol_native()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 112 def currency_symbol_native @data["currency_symbol_native"] end
hostname()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 64 def hostname @data["hostname"] end
ip()
click to toggle source
methods for fields specific to Ipregistry
# File lib/geocoder/results/ipregistry.rb, line 56 def ip @data["ip"] end
location_city()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 212 def location_city @data["location_city"] end
location_continent_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 132 def location_continent_code @data["location_continent_code"] end
location_continent_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 136 def location_continent_name @data["location_continent_name"] end
location_country_area()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 140 def location_country_area @data["location_country_area"] end
location_country_borders()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 144 def location_country_borders @data["location_country_borders"] end
location_country_calling_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 148 def location_country_calling_code @data["location_country_calling_code"] end
location_country_capital()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 152 def location_country_capital @data["location_country_capital"] end
location_country_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 156 def location_country_code @data["location_country_code"] end
location_country_flag_emoji()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 172 def location_country_flag_emoji @data["location_country_flag_emoji"] end
location_country_flag_emoji_unicode()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 176 def location_country_flag_emoji_unicode @data["location_country_flag_emoji_unicode"] end
location_country_flag_emojitwo()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 180 def location_country_flag_emojitwo @data["location_country_flag_emojitwo"] end
location_country_flag_noto()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 184 def location_country_flag_noto @data["location_country_flag_noto"] end
location_country_flag_twemoji()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 188 def location_country_flag_twemoji @data["location_country_flag_twemoji"] end
location_country_flag_wikimedia()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 192 def location_country_flag_wikimedia @data["location_country_flag_wikimedia"] end
location_country_languages()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 196 def location_country_languages @data["location_country_languages"] end
location_country_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 160 def location_country_name @data["location_country_name"] end
location_country_population()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 164 def location_country_population @data["location_country_population"] end
location_country_population_density()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 168 def location_country_population_density @data["location_country_population_density"] end
location_country_tld()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 200 def location_country_tld @data["location_country_tld"] end
location_in_eu()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 240 def location_in_eu @data["location_in_eu"] end
location_language_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 228 def location_language_code @data["location_language_code"] end
location_language_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 232 def location_language_name @data["location_language_name"] end
location_language_native()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 236 def location_language_native @data["location_language_native"] end
location_latitude()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 220 def location_latitude @data["location_latitude"] end
location_longitude()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 224 def location_longitude @data["location_longitude"] end
location_postal()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 216 def location_postal @data["location_postal"] end
location_region_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 204 def location_region_code @data["location_region_code"] end
location_region_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 208 def location_region_name @data["location_region_name"] end
postal_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 42 def postal_code @data['location_postal'] end
security_is_abuser()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 268 def security_is_abuser @data["security_is_abuser"] end
security_is_anonymous()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 264 def security_is_anonymous @data["security_is_anonymous"] end
security_is_attacker()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 272 def security_is_attacker @data["security_is_attacker"] end
security_is_bogon()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 244 def security_is_bogon @data["security_is_bogon"] end
security_is_cloud_provider()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 248 def security_is_cloud_provider @data["security_is_cloud_provider"] end
security_is_proxy()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 260 def security_is_proxy @data["security_is_proxy"] end
security_is_threat()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 276 def security_is_threat @data["security_is_threat"] end
security_is_tor()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 252 def security_is_tor @data["security_is_tor"] end
security_is_tor_exit()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 256 def security_is_tor_exit @data["security_is_tor_exit"] end
state()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 46 def state @data['location_region_name'] end
state_code()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 50 def state_code @data['location_region_code'] end
time_zone_abbreviation()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 284 def time_zone_abbreviation @data["time_zone_abbreviation"] end
time_zone_current_time()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 288 def time_zone_current_time @data["time_zone_current_time"] end
time_zone_id()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 280 def time_zone_id @data["time_zone_id"] end
time_zone_in_daylight_saving()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 300 def time_zone_in_daylight_saving @data["time_zone_in_daylight_saving"] end
time_zone_name()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 292 def time_zone_name @data["time_zone_name"] end
time_zone_offset()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 296 def time_zone_offset @data["time_zone_offset"] end
type()
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 60 def type @data["type"] end
Private Instance Methods
flatten_hash(hash)
click to toggle source
# File lib/geocoder/results/ipregistry.rb, line 16 def flatten_hash(hash) hash.each_with_object({}) do |(k, v), h| if v.is_a? Hash flatten_hash(v).map do |h_k, h_v| h["#{k}_#{h_k}".to_s] = h_v end else h[k] = v end end end