Class: IpwhoApi::GeoLocation

Inherits:
Struct
  • Object
show all
Defined in:
lib/ipwho.rb

Overview

All data objects use camelCase keys matching the API response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#accuracyRadiusObject

Returns the value of attribute accuracyRadius

Returns:

  • (Object)

    the current value of accuracyRadius



35
36
37
# File 'lib/ipwho.rb', line 35

def accuracyRadius
  @accuracyRadius
end

#capitalObject

Returns the value of attribute capital

Returns:

  • (Object)

    the current value of capital



35
36
37
# File 'lib/ipwho.rb', line 35

def capital
  @capital
end

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



35
36
37
# File 'lib/ipwho.rb', line 35

def city
  @city
end

#continentObject

Returns the value of attribute continent

Returns:

  • (Object)

    the current value of continent



35
36
37
# File 'lib/ipwho.rb', line 35

def continent
  @continent
end

#continentCodeObject

Returns the value of attribute continentCode

Returns:

  • (Object)

    the current value of continentCode



35
36
37
# File 'lib/ipwho.rb', line 35

def continentCode
  @continentCode
end

#countryObject

Returns the value of attribute country

Returns:

  • (Object)

    the current value of country



35
36
37
# File 'lib/ipwho.rb', line 35

def country
  @country
end

#countryCodeObject

Returns the value of attribute countryCode

Returns:

  • (Object)

    the current value of countryCode



35
36
37
# File 'lib/ipwho.rb', line 35

def countryCode
  @countryCode
end

#dialCodeObject

Returns the value of attribute dialCode

Returns:

  • (Object)

    the current value of dialCode



35
36
37
# File 'lib/ipwho.rb', line 35

def dialCode
  @dialCode
end

#isInEuObject

Returns the value of attribute isInEu

Returns:

  • (Object)

    the current value of isInEu



35
36
37
# File 'lib/ipwho.rb', line 35

def isInEu
  @isInEu
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



35
36
37
# File 'lib/ipwho.rb', line 35

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



35
36
37
# File 'lib/ipwho.rb', line 35

def longitude
  @longitude
end

#postalCodeObject

Returns the value of attribute postalCode

Returns:

  • (Object)

    the current value of postalCode



35
36
37
# File 'lib/ipwho.rb', line 35

def postalCode
  @postalCode
end

#regionObject

Returns the value of attribute region

Returns:

  • (Object)

    the current value of region



35
36
37
# File 'lib/ipwho.rb', line 35

def region
  @region
end

#regionCodeObject

Returns the value of attribute regionCode

Returns:

  • (Object)

    the current value of 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