Class: IpwhoApi::GeoLocation
- Inherits:
-
Struct
- Object
- Struct
- IpwhoApi::GeoLocation
- Defined in:
- lib/ipwho.rb
Overview
All data objects use camelCase keys matching the API response.
Instance Attribute Summary collapse
-
#accuracyRadius ⇒ Object
Returns the value of attribute accuracyRadius.
-
#capital ⇒ Object
Returns the value of attribute capital.
-
#city ⇒ Object
Returns the value of attribute city.
-
#continent ⇒ Object
Returns the value of attribute continent.
-
#continentCode ⇒ Object
Returns the value of attribute continentCode.
-
#country ⇒ Object
Returns the value of attribute country.
-
#countryCode ⇒ Object
Returns the value of attribute countryCode.
-
#dialCode ⇒ Object
Returns the value of attribute dialCode.
-
#isInEu ⇒ Object
Returns the value of attribute isInEu.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#postalCode ⇒ Object
Returns the value of attribute postalCode.
-
#region ⇒ Object
Returns the value of attribute region.
-
#regionCode ⇒ Object
Returns the value of attribute regionCode.
Class Method Summary collapse
Instance Attribute Details
#accuracyRadius ⇒ Object
Returns the value of attribute accuracyRadius
35 36 37 |
# File 'lib/ipwho.rb', line 35 def accuracyRadius @accuracyRadius end |
#capital ⇒ Object
Returns the value of attribute capital
35 36 37 |
# File 'lib/ipwho.rb', line 35 def capital @capital end |
#city ⇒ Object
Returns the value of attribute city
35 36 37 |
# File 'lib/ipwho.rb', line 35 def city @city end |
#continent ⇒ Object
Returns the value of attribute continent
35 36 37 |
# File 'lib/ipwho.rb', line 35 def continent @continent end |
#continentCode ⇒ Object
Returns the value of attribute continentCode
35 36 37 |
# File 'lib/ipwho.rb', line 35 def continentCode @continentCode end |
#country ⇒ Object
Returns the value of attribute country
35 36 37 |
# File 'lib/ipwho.rb', line 35 def country @country end |
#countryCode ⇒ Object
Returns the value of attribute countryCode
35 36 37 |
# File 'lib/ipwho.rb', line 35 def countryCode @countryCode end |
#dialCode ⇒ Object
Returns the value of attribute dialCode
35 36 37 |
# File 'lib/ipwho.rb', line 35 def dialCode @dialCode end |
#isInEu ⇒ Object
Returns the value of attribute isInEu
35 36 37 |
# File 'lib/ipwho.rb', line 35 def isInEu @isInEu end |
#latitude ⇒ Object
Returns the value of attribute latitude
35 36 37 |
# File 'lib/ipwho.rb', line 35 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude
35 36 37 |
# File 'lib/ipwho.rb', line 35 def longitude @longitude end |
#postalCode ⇒ Object
Returns the value of attribute postalCode
35 36 37 |
# File 'lib/ipwho.rb', line 35 def postalCode @postalCode end |
#region ⇒ Object
Returns the value of attribute region
35 36 37 |
# File 'lib/ipwho.rb', line 35 def region @region end |
#regionCode ⇒ Object
Returns the value of attribute regionCode
35 36 37 |
# File 'lib/ipwho.rb', line 35 def regionCode @regionCode end |
Class Method Details
.from_hash(hash) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ipwho.rb', line 41 def self.from_hash(hash) new( continent: hash["continent"], continentCode: hash["continentCode"], country: hash["country"], countryCode: hash["countryCode"], capital: hash["capital"], region: hash["region"], regionCode: hash["regionCode"], city: hash["city"], postalCode: hash["postal_Code"], dialCode: hash["dial_code"], isInEu: hash["is_in_eu"], latitude: hash["latitude"], longitude: hash["longitude"], accuracyRadius: hash["accuracy_radius"] ) end |