Class: Geocoder::Result::Ipregistry

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

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Instance Method Summary collapse

Methods inherited from Base

#address, #latitude, #longitude, #province, #province_code

Constructor Details

#initialize(data) ⇒ Ipregistry

Returns a new instance of Ipregistry.



6
7
8
9
10
# File 'lib/geocoder/results/ipregistry.rb', line 6

def initialize(data)
  super

  @data = flatten_hash(data)
end

Instance Method Details

#carrier_mccObject



72
73
74
# File 'lib/geocoder/results/ipregistry.rb', line 72

def carrier_mcc
  @data["carrier_mcc"]
end

#carrier_mncObject



76
77
78
# File 'lib/geocoder/results/ipregistry.rb', line 76

def carrier_mnc
  @data["carrier_mnc"]
end

#carrier_nameObject



68
69
70
# File 'lib/geocoder/results/ipregistry.rb', line 68

def carrier_name
  @data["carrier_name"]
end

#cityObject



30
31
32
# File 'lib/geocoder/results/ipregistry.rb', line 30

def city
  @data['location_city']
end

#connection_asnObject



80
81
82
# File 'lib/geocoder/results/ipregistry.rb', line 80

def connection_asn
  @data["connection_asn"]
end

#connection_domainObject



84
85
86
# File 'lib/geocoder/results/ipregistry.rb', line 84

def connection_domain
  @data["connection_domain"]
end

#connection_organizationObject



88
89
90
# File 'lib/geocoder/results/ipregistry.rb', line 88

def connection_organization
  @data["connection_organization"]
end

#connection_typeObject



92
93
94
# File 'lib/geocoder/results/ipregistry.rb', line 92

def connection_type
  @data["connection_type"]
end

#coordinatesObject



12
13
14
# File 'lib/geocoder/results/ipregistry.rb', line 12

def coordinates
  [@data['location_latitude'], @data['location_longitude']]
end

#countryObject



34
35
36
# File 'lib/geocoder/results/ipregistry.rb', line 34

def country
  @data['location_country_name']
end

#country_codeObject



38
39
40
# File 'lib/geocoder/results/ipregistry.rb', line 38

def country_code
  @data['location_country_code']
end

#currency_codeObject



96
97
98
# File 'lib/geocoder/results/ipregistry.rb', line 96

def currency_code
  @data["currency_code"]
end

#currency_format_negative_prefixObject



116
117
118
# File 'lib/geocoder/results/ipregistry.rb', line 116

def currency_format_negative_prefix
  @data["currency_format_negative_prefix"]
end

#currency_format_negative_suffixObject



120
121
122
# File 'lib/geocoder/results/ipregistry.rb', line 120

def currency_format_negative_suffix
  @data["currency_format_negative_suffix"]
end

#currency_format_positive_prefixObject



124
125
126
# File 'lib/geocoder/results/ipregistry.rb', line 124

def currency_format_positive_prefix
  @data["currency_format_positive_prefix"]
end

#currency_format_positive_suffixObject



128
129
130
# File 'lib/geocoder/results/ipregistry.rb', line 128

def currency_format_positive_suffix
  @data["currency_format_positive_suffix"]
end

#currency_nameObject



100
101
102
# File 'lib/geocoder/results/ipregistry.rb', line 100

def currency_name
  @data["currency_name"]
end

#currency_pluralObject



104
105
106
# File 'lib/geocoder/results/ipregistry.rb', line 104

def currency_plural
  @data["currency_plural"]
end

#currency_symbolObject



108
109
110
# File 'lib/geocoder/results/ipregistry.rb', line 108

def currency_symbol
  @data["currency_symbol"]
end

#currency_symbol_nativeObject



112
113
114
# File 'lib/geocoder/results/ipregistry.rb', line 112

def currency_symbol_native
  @data["currency_symbol_native"]
end

#hostnameObject



64
65
66
# File 'lib/geocoder/results/ipregistry.rb', line 64

def hostname
  @data["hostname"]
end

#ipObject

methods for fields specific to Ipregistry



56
57
58
# File 'lib/geocoder/results/ipregistry.rb', line 56

def ip
  @data["ip"]
end

#location_cityObject



212
213
214
# File 'lib/geocoder/results/ipregistry.rb', line 212

def location_city
  @data["location_city"]
end

#location_continent_codeObject



132
133
134
# File 'lib/geocoder/results/ipregistry.rb', line 132

def location_continent_code
  @data["location_continent_code"]
end

#location_continent_nameObject



136
137
138
# File 'lib/geocoder/results/ipregistry.rb', line 136

def location_continent_name
  @data["location_continent_name"]
end

#location_country_areaObject



140
141
142
# File 'lib/geocoder/results/ipregistry.rb', line 140

def location_country_area
  @data["location_country_area"]
end

#location_country_bordersObject



144
145
146
# File 'lib/geocoder/results/ipregistry.rb', line 144

def location_country_borders
  @data["location_country_borders"]
end

#location_country_calling_codeObject



148
149
150
# File 'lib/geocoder/results/ipregistry.rb', line 148

def location_country_calling_code
  @data["location_country_calling_code"]
end

#location_country_capitalObject



152
153
154
# File 'lib/geocoder/results/ipregistry.rb', line 152

def location_country_capital
  @data["location_country_capital"]
end

#location_country_codeObject



156
157
158
# File 'lib/geocoder/results/ipregistry.rb', line 156

def location_country_code
  @data["location_country_code"]
end

#location_country_flag_emojiObject



172
173
174
# File 'lib/geocoder/results/ipregistry.rb', line 172

def location_country_flag_emoji
  @data["location_country_flag_emoji"]
end

#location_country_flag_emoji_unicodeObject



176
177
178
# File 'lib/geocoder/results/ipregistry.rb', line 176

def location_country_flag_emoji_unicode
  @data["location_country_flag_emoji_unicode"]
end

#location_country_flag_emojitwoObject



180
181
182
# File 'lib/geocoder/results/ipregistry.rb', line 180

def location_country_flag_emojitwo
  @data["location_country_flag_emojitwo"]
end

#location_country_flag_notoObject



184
185
186
# File 'lib/geocoder/results/ipregistry.rb', line 184

def location_country_flag_noto
  @data["location_country_flag_noto"]
end

#location_country_flag_twemojiObject



188
189
190
# File 'lib/geocoder/results/ipregistry.rb', line 188

def location_country_flag_twemoji
  @data["location_country_flag_twemoji"]
end

#location_country_flag_wikimediaObject



192
193
194
# File 'lib/geocoder/results/ipregistry.rb', line 192

def location_country_flag_wikimedia
  @data["location_country_flag_wikimedia"]
end

#location_country_languagesObject



196
197
198
# File 'lib/geocoder/results/ipregistry.rb', line 196

def location_country_languages
  @data["location_country_languages"]
end

#location_country_nameObject



160
161
162
# File 'lib/geocoder/results/ipregistry.rb', line 160

def location_country_name
  @data["location_country_name"]
end

#location_country_populationObject



164
165
166
# File 'lib/geocoder/results/ipregistry.rb', line 164

def location_country_population
  @data["location_country_population"]
end

#location_country_population_densityObject



168
169
170
# File 'lib/geocoder/results/ipregistry.rb', line 168

def location_country_population_density
  @data["location_country_population_density"]
end

#location_country_tldObject



200
201
202
# File 'lib/geocoder/results/ipregistry.rb', line 200

def location_country_tld
  @data["location_country_tld"]
end

#location_in_euObject



240
241
242
# File 'lib/geocoder/results/ipregistry.rb', line 240

def location_in_eu
  @data["location_in_eu"]
end

#location_language_codeObject



228
229
230
# File 'lib/geocoder/results/ipregistry.rb', line 228

def location_language_code
  @data["location_language_code"]
end

#location_language_nameObject



232
233
234
# File 'lib/geocoder/results/ipregistry.rb', line 232

def location_language_name
  @data["location_language_name"]
end

#location_language_nativeObject



236
237
238
# File 'lib/geocoder/results/ipregistry.rb', line 236

def location_language_native
  @data["location_language_native"]
end

#location_latitudeObject



220
221
222
# File 'lib/geocoder/results/ipregistry.rb', line 220

def location_latitude
  @data["location_latitude"]
end

#location_longitudeObject



224
225
226
# File 'lib/geocoder/results/ipregistry.rb', line 224

def location_longitude
  @data["location_longitude"]
end

#location_postalObject



216
217
218
# File 'lib/geocoder/results/ipregistry.rb', line 216

def location_postal
  @data["location_postal"]
end

#location_region_codeObject



204
205
206
# File 'lib/geocoder/results/ipregistry.rb', line 204

def location_region_code
  @data["location_region_code"]
end

#location_region_nameObject



208
209
210
# File 'lib/geocoder/results/ipregistry.rb', line 208

def location_region_name
  @data["location_region_name"]
end

#postal_codeObject



42
43
44
# File 'lib/geocoder/results/ipregistry.rb', line 42

def postal_code
  @data['location_postal']
end

#security_is_abuserObject



268
269
270
# File 'lib/geocoder/results/ipregistry.rb', line 268

def security_is_abuser
  @data["security_is_abuser"]
end

#security_is_anonymousObject



264
265
266
# File 'lib/geocoder/results/ipregistry.rb', line 264

def security_is_anonymous
  @data["security_is_anonymous"]
end

#security_is_attackerObject



272
273
274
# File 'lib/geocoder/results/ipregistry.rb', line 272

def security_is_attacker
  @data["security_is_attacker"]
end

#security_is_bogonObject



244
245
246
# File 'lib/geocoder/results/ipregistry.rb', line 244

def security_is_bogon
  @data["security_is_bogon"]
end

#security_is_cloud_providerObject



248
249
250
# File 'lib/geocoder/results/ipregistry.rb', line 248

def security_is_cloud_provider
  @data["security_is_cloud_provider"]
end

#security_is_proxyObject



260
261
262
# File 'lib/geocoder/results/ipregistry.rb', line 260

def security_is_proxy
  @data["security_is_proxy"]
end

#security_is_threatObject



276
277
278
# File 'lib/geocoder/results/ipregistry.rb', line 276

def security_is_threat
  @data["security_is_threat"]
end

#security_is_torObject



252
253
254
# File 'lib/geocoder/results/ipregistry.rb', line 252

def security_is_tor
  @data["security_is_tor"]
end

#security_is_tor_exitObject



256
257
258
# File 'lib/geocoder/results/ipregistry.rb', line 256

def security_is_tor_exit
  @data["security_is_tor_exit"]
end

#stateObject



46
47
48
# File 'lib/geocoder/results/ipregistry.rb', line 46

def state
  @data['location_region_name']
end

#state_codeObject



50
51
52
# File 'lib/geocoder/results/ipregistry.rb', line 50

def state_code
  @data['location_region_code']
end

#time_zone_abbreviationObject



284
285
286
# File 'lib/geocoder/results/ipregistry.rb', line 284

def time_zone_abbreviation
  @data["time_zone_abbreviation"]
end

#time_zone_current_timeObject



288
289
290
# File 'lib/geocoder/results/ipregistry.rb', line 288

def time_zone_current_time
  @data["time_zone_current_time"]
end

#time_zone_idObject



280
281
282
# File 'lib/geocoder/results/ipregistry.rb', line 280

def time_zone_id
  @data["time_zone_id"]
end

#time_zone_in_daylight_savingObject



300
301
302
# File 'lib/geocoder/results/ipregistry.rb', line 300

def time_zone_in_daylight_saving
  @data["time_zone_in_daylight_saving"]
end

#time_zone_nameObject



292
293
294
# File 'lib/geocoder/results/ipregistry.rb', line 292

def time_zone_name
  @data["time_zone_name"]
end

#time_zone_offsetObject



296
297
298
# File 'lib/geocoder/results/ipregistry.rb', line 296

def time_zone_offset
  @data["time_zone_offset"]
end

#typeObject



60
61
62
# File 'lib/geocoder/results/ipregistry.rb', line 60

def type
  @data["type"]
end