Class: Geocoder::Result::MelissaStreet

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

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Instance Method Summary collapse

Methods inherited from Base

#initialize, #latitude, #longitude, #province, #province_code

Constructor Details

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

Instance Method Details

#address(format = :full) ⇒ Object



5
6
7
# File 'lib/geocoder/results/melissa_street.rb', line 5

def address(format = :full)
  @data['FormattedAddress']
end

#cityObject



21
22
23
# File 'lib/geocoder/results/melissa_street.rb', line 21

def city
  @data['Locality']
end

#coordinatesObject



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

def coordinates
  [@data['Latitude'].to_f, @data['Longitude'].to_f]
end

#countryObject



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

def country
  @data['CountryName']
end

#country_codeObject



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

def country_code
  @data['CountryISO3166_1_Alpha2']
end

#numberObject



17
18
19
# File 'lib/geocoder/results/melissa_street.rb', line 17

def number
  @data['PremisesNumber']
end

#postal_codeObject



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

def postal_code
  @data['PostalCode']
end

#state_codeObject Also known as: state



25
26
27
# File 'lib/geocoder/results/melissa_street.rb', line 25

def state_code
  @data['AdministrativeArea']
end

#street_addressObject



9
10
11
# File 'lib/geocoder/results/melissa_street.rb', line 9

def street_address
  @data['AddressLine1']
end

#suffixObject



13
14
15
# File 'lib/geocoder/results/melissa_street.rb', line 13

def suffix
  @data['ThoroughfareTrailingType']
end