Class: Geocoder::Result::AbstractApi

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

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Instance Method Summary collapse

Methods inherited from Base

#address, #coordinates, #initialize, #latitude, #longitude, #province, #province_code

Constructor Details

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

Instance Method Details

#cityObject



18
19
20
# File 'lib/geocoder/results/abstract_api.rb', line 18

def city
  @data["city"]
end

#city_geoname_idObject



22
23
24
# File 'lib/geocoder/results/abstract_api.rb', line 22

def city_geoname_id
  @data["city_geoname_id"]
end

#connection_autonomous_system_numberObject

Connection



125
126
127
# File 'lib/geocoder/results/abstract_api.rb', line 125

def connection_autonomous_system_number
  @data.dig "connection", "autonomous_system_number"
end

#connection_autonomous_system_organizationObject



129
130
131
# File 'lib/geocoder/results/abstract_api.rb', line 129

def connection_autonomous_system_organization
  @data.dig "connection", "autonomous_system_organization"
end

#connection_connection_typeObject



133
134
135
# File 'lib/geocoder/results/abstract_api.rb', line 133

def connection_connection_type
  @data.dig "connection", "connection_type"
end

#connection_isp_nameObject



137
138
139
# File 'lib/geocoder/results/abstract_api.rb', line 137

def connection_isp_name
  @data.dig "connection", "isp_name"
end

#connection_organization_nameObject



141
142
143
# File 'lib/geocoder/results/abstract_api.rb', line 141

def connection_organization_name
  @data.dig "connection", "organization_name"
end

#continentObject



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

def continent
  @data["continent"]
end

#continent_codeObject



54
55
56
# File 'lib/geocoder/results/abstract_api.rb', line 54

def continent_code
  @data["continent_code"]
end

#continent_geoname_idObject



58
59
60
# File 'lib/geocoder/results/abstract_api.rb', line 58

def continent_geoname_id
  @data["continent_geoname_id"]
end

#countryObject



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

def country
  @data["country"]
end

#country_codeObject



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

def country_code
  @data["country_code"]
end

#country_geoname_idObject



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

def country_geoname_id
  @data["country_geoname_id"]
end

#country_is_euObject



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

def country_is_eu
  @data["country_is_eu"]
end

#currency_currency_codeObject



118
119
120
# File 'lib/geocoder/results/abstract_api.rb', line 118

def currency_currency_code
  @data.dig "currency", "currency_code"
end

#currency_currency_nameObject

Currency



114
115
116
# File 'lib/geocoder/results/abstract_api.rb', line 114

def currency_currency_name
  @data.dig "currency", "currency_name"
end

#flag_emojiObject

Flag



95
96
97
# File 'lib/geocoder/results/abstract_api.rb', line 95

def flag_emoji
  @data.dig "flag", "emoji"
end

#flag_pngObject



103
104
105
# File 'lib/geocoder/results/abstract_api.rb', line 103

def flag_png
  @data.dig "flag", "png"
end

#flag_svgObject



107
108
109
# File 'lib/geocoder/results/abstract_api.rb', line 107

def flag_svg
  @data.dig "flag", "svg"
end

#flag_unicodeObject



99
100
101
# File 'lib/geocoder/results/abstract_api.rb', line 99

def flag_unicode
  @data.dig "flag", "unicode"
end

#is_vpn?Boolean

Security

Returns:

  • (Boolean)


65
66
67
# File 'lib/geocoder/results/abstract_api.rb', line 65

def is_vpn?
  @data.dig "security", "is_vpn"
end

#postal_codeObject



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

def postal_code
  @data["postal_code"]
end

#region_geoname_idObject



26
27
28
# File 'lib/geocoder/results/abstract_api.rb', line 26

def region_geoname_id
  @data["region_geoname_id"]
end

#stateObject

Geolocation



10
11
12
# File 'lib/geocoder/results/abstract_api.rb', line 10

def state
  @data['region']
end

#state_codeObject



14
15
16
# File 'lib/geocoder/results/abstract_api.rb', line 14

def state_code
  @data['region_iso_code']
end

#timezone_abbreviationObject



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

def timezone_abbreviation
  @data.dig "timezone", "abbreviation"
end

#timezone_current_timeObject



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

def timezone_current_time
  @data.dig "timezone", "current_time"
end

#timezone_gmt_offsetObject



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

def timezone_gmt_offset
  @data.dig "timezone", "gmt_offset"
end

#timezone_is_dstObject



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

def timezone_is_dst
  @data.dig "timezone", "is_dst"
end

#timezone_nameObject

Timezone



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

def timezone_name
  @data.dig "timezone", "name"
end