Class: Yahoo::Geocode::Location

Inherits:
Struct
  • Object
show all
Defined in:
lib/yahoo/geocode.rb,
lib/yahoo/geocode.rb

Overview

A Location contains the following fields:

latitude

Latitude of the location

longitude

Longitude of the location

address

Street address of the result, if a specific location could be determined

city

City in which the result is located

state

State in which the result is located

zip

Zip code, if known

country

Country in which the result is located

precision

The precision of the address used for geocoding

warning

If the exact address was not found, the closest available match

Precision can be one of the following, from most specific to most general:

  • address

  • street

  • zip+4

  • zip+2

  • zip

  • city

  • state

  • country

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address

Returns:

  • (Object)

    the current value of address



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def address
  @address
end

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def city
  @city
end

#countryObject

Returns the value of attribute country

Returns:

  • (Object)

    the current value of country



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def country
  @country
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def longitude
  @longitude
end

#precisionObject

Returns the value of attribute precision

Returns:

  • (Object)

    the current value of precision



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def precision
  @precision
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def state
  @state
end

#warningObject

Returns the value of attribute warning

Returns:

  • (Object)

    the current value of warning



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def warning
  @warning
end

#zipObject

Returns the value of attribute zip

Returns:

  • (Object)

    the current value of zip



16
17
18
# File 'lib/yahoo/geocode.rb', line 16

def zip
  @zip
end

Instance Method Details

#coordinatesObject

Returns an Array with latitude and longitude.



100
101
102
# File 'lib/yahoo/geocode.rb', line 100

def coordinates
  [latitude, longitude]
end